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 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: 701
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
Zimbra Consultant
 
Posts: 5,814
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
__________________
-Mike Morse (MCode151)

ZCS-to-ZCS Migrations & Moves | Admin Tools & Tidbits » ZimbraBlog.com | ZimbraCommunity.com
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
Zimbra Consultant
 
Posts: 5,814
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
__________________
-Mike Morse (MCode151)

ZCS-to-ZCS Migrations & Moves | Admin Tools & Tidbits » ZimbraBlog.com | ZimbraCommunity.com
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
Reply


Thread Tools
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.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0