Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-03-2007, 03:30 AM
Intermediate Member
 
Posts: 22
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
Reply With Quote
  #2 (permalink)  
Old 12-03-2007, 06:35 AM
Moderator
 
Posts: 927
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.
Reply With Quote
  #3 (permalink)  
Old 12-03-2007, 07:57 AM
Moderator
 
Posts: 6,236
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
Reply With Quote
  #4 (permalink)  
Old 12-03-2007, 09:51 AM
Intermediate Member
 
Posts: 22
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
Reply With Quote
  #5 (permalink)  
Old 12-03-2007, 10:15 AM
Moderator
 
Posts: 6,236
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
Reply With Quote
  #6 (permalink)  
Old 03-03-2009, 07:44 PM
Junior Member
 
Posts: 5
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?
Reply With Quote
  #7 (permalink)  
Old 10-05-2009, 04:01 AM
Intermediate Member
 
Posts: 21
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
Reply With Quote
  #8 (permalink)  
Old 01-26-2010, 02:01 PM
Special Member
 
Posts: 103
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.