Results 1 to 7 of 7

Thread: Purging mail from unused accounts

  1. #1
    Join Date
    Oct 2007
    Location
    Omaha
    Posts
    33
    Rep Power
    8

    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?

  2. #2
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    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.

  3. #3
    Join Date
    Oct 2007
    Location
    Omaha
    Posts
    33
    Rep Power
    8

    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.

  4. #4
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    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.

  5. #5
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

  6. #6
    Join Date
    Apr 2008
    Posts
    3
    Rep Power
    7

    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

  7. #7
    Join Date
    Apr 2006
    Location
    Illinois
    Posts
    194
    Rep Power
    9

    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.

Similar Threads

  1. Problems with port 25
    By yogiman in forum Installation
    Replies: 57
    Last Post: 06-13-2011, 01:55 PM
  2. Replies: 7
    Last Post: 02-03-2011, 06:01 AM
  3. server dropped connection
    By ferra in forum Installation
    Replies: 20
    Last Post: 10-06-2008, 04:32 PM
  4. fresh install down may be due to tomcat
    By gon in forum Installation
    Replies: 10
    Last Post: 07-25-2007, 08:09 AM
  5. receiveing mail
    By maybethistime in forum Administrators
    Replies: 15
    Last Post: 12-09-2005, 03:55 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
  •