Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
  #1 (permalink)  
Old 11-09-2007, 09:01 AM
Brian@MCC's Avatar
Brian@MCC Brian@MCC is offline
Senior Member
 
Join Date: Oct 2007
Location: Omaha
Posts: 30
Brian@MCC is on a distinguished road
Default Purging mail from unused accounts

Say I have a list of oh, 3000 students who are not enrolled currently buy have mailboxes on my server. I'd like to purge their mail without actually deleting their mail boxes. Is there a quick and dirty way of doing this?
Reply With Quote
  #2 (permalink)  
Old 11-09-2007, 09:35 AM
mmorse's Avatar
mmorse mmorse is offline
Zimbra Employee
 
Join Date: May 2006
Location: USA
ZCS Version: NE & OS - in the many flavors of 4.5 & 5.0
Posts: 4,257
mmorse is on a distinguished road
Send a message via AIM to mmorse Send a message via MSN to mmorse Send a message via Yahoo to mmorse Send a message via Skype™ to mmorse
Default

2 methods:

A) First so you don't have to manually go through each one, make sure their in their own COS (alumni or graduated etc)
(you can even script the COS change if you have a list of the user's handy)

In the admin console gui > cos (or individual user) > advanced tab > scroll to the bottom > and you can set:
Email message lifetime -Number of days a message can remain in any folder before it is automatically purged. The default is 0; email messages are not deleted.
Set this to 1
(let me know if you want zmprov commands instead-but it's really easy to find)

B) There's also the emptyFolder command but if they have /Folder at the same level as /Inbox it doesn't help you at all.

zmmailbox -z -m user@domain.com emptyFolder /Inbox

OR

zmmailbox -a admin -p password -m user@domain.com emptyFolder /Inbox

OR

zmmailbox
mbox> adminAuthenticate -u https://server.domain.com:7071 admin@domain.com password
mbox> selectMailbox user@domain.com
mbox user@domain.com> emptyFolder /Inbox


I would do A because it's the easiest, followed by B for the /Calendars /Notebook etc
You could get pickier on folder names/write a script to get all folders etc, but that's probably most of the used storage space anyways.
Reply With Quote
  #3 (permalink)  
Old 11-09-2007, 09:58 AM
Brian@MCC's Avatar
Brian@MCC Brian@MCC is offline
Senior Member
 
Join Date: Oct 2007
Location: Omaha
Posts: 30
Brian@MCC is on a distinguished road
Default

Quote:
Originally Posted by mmorse View Post
2 methods:

A) First so you don't have to manually go through each one, make sure their in their own COS (alumni or graduated etc)
(you can even script the COS change if you have a list of the user's handy)

In the admin console gui > cos (or individual user) > advanced tab > scroll to the bottom > and you can set:
Email message lifetime -Number of days a message can remain in any folder before it is automatically purged. The default is 0; email messages are not deleted.
Set this to 1
(let me know if you want zmprov commands instead-but it's really easy to find)

B) There's also the emptyFolder command but if they have /Folder at the same level as /Inbox it doesn't help you at all.

zmmailbox -z -m user@domain.com emptyFolder /Inbox

OR

zmmailbox -a admin -p password -m user@domain.com emptyFolder /Inbox

OR

zmmailbox
mbox> adminAuthenticate -u https://server.domain.com:7071 admin@domain.com password
mbox> selectMailbox user@domain.com
mbox user@domain.com> emptyFolder /Inbox


I would do A because it's the easiest, followed by B for the /Calendars /Notebook etc
You could get pickier on folder names/write a script to get all folders etc, but that's probably most of the used storage space anyways.
Good stuff. I'll take some zmprov suggestions or examples you have as well. My goal for now is to just empty out those users who aren't enrolled but are sitting in the system collecting spam that isn't moved to "Junk". So if I can zmprov a buttload of them at once that would make my day go by a bit easier.
Reply With Quote
  #4 (permalink)  
Old 11-09-2007, 11:03 AM
mmorse's Avatar
mmorse mmorse is offline
Zimbra Employee
 
Join Date: May 2006
Location: USA
ZCS Version: NE & OS - in the many flavors of 4.5 & 5.0
Posts: 4,257
mmorse is on a distinguished road
Send a message via AIM to mmorse Send a message via MSN to mmorse Send a message via Yahoo to mmorse Send a message via Skype™ to mmorse
Default

You may also find these account status modes useful:

Closed -When a mailbox status is closed, the login is disabled, and messages are bounced. This status is used to soft-delete an account before deleting it from the server.

OR

Locked - When a mailbox status is locked, the user cannot log in, but mail is still delivered to the account. The locked status can be set, if you suspect that a mail account has been hacked or is being used in an unauthorized manner.

Though you don't need too, you might use locked if your planning on lifetime email forwarding or something... (Which is something that more and more schools are starting, or at a minimum forward for at least a year etc.)

Are these just prior enrolled students/recent grads etc? You may take a policy something like:
-Notify them that you're going to be deleting their old mail & that new mail will be around for only 7 days or something. At the same time you could give them directions for setting up forwarding (either within the web-client or a portal). It may be beneficial to provide directions on copying their mail via IMAP/POP.
-Set the spam/junk & trash lifetimes to 1 day
-Wait a 'few days'
-Set email message lifetime 7 days
-After another month or so lock all the accounts & switch to email forwarding only configurable in a portal or by request.
-After a year or whatever (if you're not a 'lifetime' kinda school) then delete the accounts

Last edited by mmorse : 11-09-2007 at 11:16 AM.
Reply With Quote
  #5 (permalink)  
Old 11-09-2007, 11:13 AM
mmorse's Avatar
mmorse mmorse is offline
Zimbra Employee
 
Join Date: May 2006
Location: USA
ZCS Version: NE & OS - in the many flavors of 4.5 & 5.0
Posts: 4,257
mmorse is on a distinguished road
Send a message via AIM to mmorse Send a message via MSN to mmorse Send a message via Yahoo to mmorse Send a message via Skype™ to mmorse
Default

Start here:
Zmprov - Zimbra :: Wiki
Zmprov Examples - Zimbra :: Wiki
Bulk Provisioning - Zimbra :: Wiki
Reply With Quote
  #6 (permalink)  
Old 04-18-2008, 01:55 PM
SteveLoweIL SteveLoweIL is offline
Junior Member
 
Join Date: Apr 2008
Posts: 3
SteveLoweIL is on a distinguished road
Default

Strong possibility that we will move to Zimbra for our students in the next 12 months.
On our UNIX system, I have an expire_mail program that can 'toast' any and all messages. Normally, I use it to remove listserv messages from our STUDENTS list.

Does Zimbra offer that capability using the system commands?

Steve Lowe
Aurora University
__________________
Steve Lowe
Director, Computer Center
Aurora University
Reply With Quote
  #7 (permalink)  
Old 04-18-2008, 02:39 PM
kirme3 kirme3 is offline
Special Member
 
Join Date: Apr 2006
Location: Illinois
ZCS Version: Release 4.5.11_GA_1751.MACOSX, Zimbra, Inc.
Posts: 168
kirme3 is on a distinguished road
Default

The zmmailbox command can be used to do searches on individual mailboxes and delete. But it's a one at a time thing. You may want to vote for this request though:
Bug 24798 - RFE: Locate and delete messages from multiple mailboxes

Looks like it is scheduled for 5.5 right now, which is currently slated for Q4 this year according to the roadmap.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
server dropped connection ferra Installation 19 10-24-2007 05:30 PM
fresh install down may be due to tomcat gon Installation 10 07-25-2007 08:09 AM
Problems with port 25 yogiman Installation 55 09-25-2006 06:14 AM
Post install : Zimbra start up is taking upwards of 10 minutes zcook Installation 6 12-27-2005 03:47 PM
receiveing mail maybethistime Administrators 15 12-09-2005 03:55 PM


freshmeat.net sourceforge.net The best Java IDE



 

Search Engine Optimization by vBSEO 3.0.0