Results 1 to 8 of 8

Thread: [SOLVED] How can I delete all emails from a single account?

  1. #1
    AlanWilliamson is offline Intermediate Member
    Join Date
    Dec 2005
    Location
    Scotland
    Posts
    22
    Rep Power
    9

    Default [SOLVED] How can I delete all emails from a single account?

    My main "admin" account has over 100,000 emails in it. 99% of them are from cron jobs that went wrong!

    What is a quick way for me to completely nuke all the emails in this particular box?

    thanks

  2. #2
    Dirk's Avatar
    Dirk is offline Moderator
    Join Date
    May 2006
    Location
    England.
    Posts
    927
    Rep Power
    9

    Default

    I'm not aware of a function for this, although I suspect there may be one. There are a few hacks to accomplish your goal though.

    You could point a pop3 client at the account and set it not to leave the mail on the server. Leaving that to run for a few minutes should rip all the mail out of the mailbox.

    You could write a short perl script to accomplish the same goal.

    You could delete the account and then create a new one by the same name.

    Other than those, I dont know.

  3. #3
    mmorse's Avatar
    mmorse is offline Moderator
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    20

    Default

    zmmailbox -z -m admin@domain.com emptyFolder /foldernamelikeInbox

    or set the email message lifetime to 1 day (easily found in admin console > account> advanced> bottom of page)
    -this is the lifetime that an email message can remain in any folder
    -0 means don't delete
    -see also trash and spam lifetimes
    -let us know if you want the CLI for this

  4. #4
    AlanWilliamson is offline Intermediate Member
    Join Date
    Dec 2005
    Location
    Scotland
    Posts
    22
    Rep Power
    9

    Default

    Mike! You are a genius!

    that worked beautifully, and yes, I found the message-alive parameter that is now set to just 1 day.

    T H A N K Y O U

  5. #5
    mmorse's Avatar
    mmorse is offline Moderator
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    20

    Default

    Just don't accidentally set that so low on a commonly used COS instead of an individual account, or users will become really pissed really fast

  6. #6
    protenus is offline Junior Member
    Join Date
    May 2007
    Posts
    5
    Rep Power
    7

    Default No longer works for new versions

    Just a note, now the admin interface enforces a 30 day minumum....

    Any new ideas how to do this?

  7. #7
    hocky is offline Intermediate Member
    Join Date
    May 2009
    Location
    Nantes / France
    Posts
    21
    Rep Power
    5

    Red face

    Something like this should do the trick:

    Code:
    for m in `zmmailbox -m account@domaine.com -p pwd gaf |awk '/\// {print $5}'|sort|uniq` ; do zmmailbox -m account@domaine.com -p pwd emptyFolder $m ; done

  8. #8
    thunder04 is offline Special Member
    Join Date
    Dec 2007
    Location
    At work...Menlo Park, CA
    Posts
    155
    Rep Power
    7

    Default

    Is there a way to delete items that are in unknown folders? I have a bunch of closed accounts (linked to AD, their usernames are disabled), and I'm working on cleaning out the accounts...but I don't know if users have organized their mail into folders or whatnot.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Allow single account to be domain admin over multiple domains
    By peter@mxtoolbox.com in forum Administrators
    Replies: 2
    Last Post: 03-19-2008, 12:36 PM
  2. restore single mail folder for account?
    By gkra in forum Administrators
    Replies: 9
    Last Post: 07-30-2007, 03:19 PM
  3. Single Account Issue
    By Travis Kensil in forum Administrators
    Replies: 9
    Last Post: 06-06-2007, 05:06 PM
  4. Auto delete emails
    By scandog in forum Administrators
    Replies: 8
    Last Post: 12-23-2006, 03:24 AM
  5. Delete Account (zcs-3.0.0_M3_436a.FC3)
    By chanck in forum Installation
    Replies: 2
    Last Post: 01-17-2006, 06:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •