Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
 
Go Back   Zimbra - Forums > Other > Zimbra in Education

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 11-09-2007, 10:01 AM
Active Member
 
Posts: 32
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, 10:35 AM
Zimbra Consultant
 
Posts: 5,814
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.
__________________
-Mike Morse (MCode151)

ZCS-to-ZCS Migrations & Moves | Admin Tools & Tidbits » ZimbraBlog.com | ZimbraCommunity.com
Reply With Quote
  #3 (permalink)  
Old 11-09-2007, 10:58 AM
Active Member
 
Posts: 32
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, 12:03 PM
Zimbra Consultant
 
Posts: 5,814
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
__________________
-Mike Morse (MCode151)

ZCS-to-ZCS Migrations & Moves | Admin Tools & Tidbits » ZimbraBlog.com | ZimbraCommunity.com

Last edited by mmorse : 11-09-2007 at 12:16 PM.
Reply With Quote
  #5 (permalink)  
Old 11-09-2007, 12:13 PM
Zimbra Consultant
 
Posts: 5,814
Default

Start here:
Zmprov - Zimbra :: Wiki
Zmprov Examples - Zimbra :: Wiki
Bulk Provisioning - Zimbra :: Wiki
__________________
-Mike Morse (MCode151)

ZCS-to-ZCS Migrations & Moves | Admin Tools & Tidbits » ZimbraBlog.com | ZimbraCommunity.com
Reply With Quote
  #6 (permalink)  
Old 04-18-2008, 02:55 PM
New Member
 
Posts: 3
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, 03:39 PM
Trained Alumni
 
Posts: 190
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


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