Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Auto-Purging

  1. #1
    tbenoit is offline Intermediate Member
    Join Date
    Jun 2007
    Posts
    15
    Rep Power
    8

    Default Auto-Purging

    We're evaluating the Network Edition for a possible migration to it.

    One thing we have the need for is per-folder message aging. I know such a thing doesn't exist in Zimbra, but there is a BugID on it (I did vote for it, but it only has 4 Votes). But, to get around that we can search for messages and delete them. My main concern is one specific folder that receives thousands of emails daily (status emails for servers, jobs, etc). After 4-6 weeks, we'll have hundreds of thousands of emails in that one folder. We'd like to clean it out after 6 weeks, but manually deleting them after a search isn't a real option as there will be thousands of emails to delete.

    Anyone has any ideas of how to better automate the deleting of emails from a folder using the current release version of Zimbra?

  2. #2
    phoenix is online now Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,470
    Rep Power
    56

    Default

    Set-up a cron job and clear it with zmmailbox? Have a look at 'zmmailbox help commands' run as the zimbra user.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  3. #3
    tbenoit is offline Intermediate Member
    Join Date
    Jun 2007
    Posts
    15
    Rep Power
    8

    Default

    Ah. Thanks for pointing that out. I'm looking into that command now.

  4. #4
    phoenix is online now Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,470
    Rep Power
    56

    Default

    I forgot to mention that you should use a test account for checking the functionality of the command, once mail is deleted with zmmailbox - it's gone and no going back.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  5. #5
    tbenoit is offline Intermediate Member
    Join Date
    Jun 2007
    Posts
    15
    Rep Power
    8

    Default

    Quote Originally Posted by phoenix View Post
    I forgot to mention that you should use a test account for checking the functionality of the command, once mail is deleted with zmmailbox - it's gone and no going back.
    Heh... Thanks. Everything is a Test Account right now. Way too early to actually migrate over.

    I've exhausted the Help, Wiki and Documentation for command assistance. Searching the forums now. Not much in the docs on how to search & delete messages

  6. #6
    tbenoit is offline Intermediate Member
    Join Date
    Jun 2007
    Posts
    15
    Rep Power
    8

    Default

    From the information in the different sources, I think I was able to put together the appropriate command:

    Code:
    zmmailbox -z -m mailbox@mydomain.com search -l 1000 "in:/Folder/To/Search/In (before:6/10/2007)" | grep "\. -" | cut -f2 -d"-" | cut -f1 -d" "
    I believe that is providing the IDs that I'd need to delete for all messages in that folder before 06/10/2007.

    Is there a possibility you can increase the maximum search result value to be much larger than 1000? When I enter 1001 it only shows 30 results.

  7. #7
    djve's Avatar
    djve is offline Senior Member
    Join Date
    May 2007
    Location
    San Mateo
    Posts
    68
    Rep Power
    8

    Default

    What's the bug number? I'll vote for it too.

    Also, is there a bug that you know of for zmmailbox search? I get the same problem. And we're evaluating the Network Edition too.

  8. #8
    tbenoit is offline Intermediate Member
    Join Date
    Jun 2007
    Posts
    15
    Rep Power
    8

    Default

    Quote Originally Posted by djve View Post
    What's the bug number? I'll vote for it too.
    Bug 6542 - Zimbra Message Store & HSM Aging Policies


    Quote Originally Posted by djve View Post
    Also, is there a bug that you know of for zmmailbox search? I get the same problem. And we're evaluating the Network Edition too.
    I don't know of a bug, but I got it to work using the command above in a script:

    Code:
    #!/bin/bash
    #
    #
    THEACCOUNT="myuser@mydomain.com"
    THEDATE="06/10/2007"
    THEFOLDER="/Folder/To/Search/Into"
    for i in `zmmailbox -z -m $THEACCOUNT search -l 1000 "in:$THEFOLDER (before:$THEDATE)" | grep "\. -" | cut -f2 -d"-" | cut -f1 -d" "`
      do
        echo "Deleting Message ID: $i"
        zmmailbox -z -m $THEACCOUNT deleteMessage $i
      done
    #
    This will delete the messages the search finds (all emails before 06/10/2007).

    It's not very efficient as each "deleteMessage" command takes about 1 second, so deleting 1000 messages will take a bit of time. It's also a server-side "pig" in resources, bringing a basically idle server (just 1 domain and 1 test email account) to high CPU & I/O utilization. The server I'm testing on isn't a "beast" but it's no slouch either (Intel Conroe 3060 Dual Core, 4GB RAM, 4 x 146GB SAS HDD in RAID-10).

  9. #9
    jerelabs is offline Active Member
    Join Date
    Jul 2007
    Posts
    30
    Rep Power
    8

    Default

    When running just the search command I notice that some IDs have a '-' in front of them.

    What is the significance of this?

  10. #10
    dkarp is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    11

    Default

    Quote Originally Posted by jerelabs View Post
    When running just the search command I notice that some IDs have a '-' in front of them.

    What is the significance of this?
    "Virtual" conversations wrapping a single message. They're not actually persisted in the database.
    Bugzilla - Wiki - Downloads - Before posting... Search!

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 07-31-2007, 11:17 PM
  2. Auto timezone problem in calendar
    By kdunphy in forum Administrators
    Replies: 8
    Last Post: 03-19-2007, 05:54 PM
  3. zimbra 4.5RC2 pop accounts auto check???
    By nfear24 in forum Administrators
    Replies: 5
    Last Post: 01-30-2007, 01:25 PM
  4. Email Address Auto complete
    By mcavalieri in forum Users
    Replies: 5
    Last Post: 07-10-2006, 02:08 PM
  5. Email auto complete in 3.1 ?
    By sperkins in forum Administrators
    Replies: 2
    Last Post: 04-29-2006, 05:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •