Results 1 to 3 of 3

Thread: Deleting old emails

  1. #1
    Tony Lewis is offline Member
    Join Date
    Mar 2007
    Posts
    12
    Rep Power
    8

    Default Deleting old emails

    I am using the always_bcc setting in postfix to archive all emails. But I only need to do it for a certain time. Once a mail item is more than a few weeks old, I'm happy to delete it.

    What's the best way to do this in Zimbra?

    The mail filters don't have an 'older than' clause.

    I tried something like delete from mail_item where date < xxxx; in the database, but got scary warnings about hierarchical keys:
    ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`mboxgroup20/mail_item`, CONSTRAINT `fk_mail_item_folder_id` FOREIGN KEY (`mailbox_id`, `folder_id`) REFERENCES `mail_item` (`mailbox_id`, `id`))

    I'd like to be able to script this in a cron job, rather than having to use the web interface or IMAP.

    Any suggestions?
    Last edited by Tony Lewis; 06-24-2007 at 04:58 AM. Reason: reformatting, addition

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

    Default

    Use zmmailbox, does this post give you a pointer?
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  3. #3
    Tony Lewis is offline Member
    Join Date
    Mar 2007
    Posts
    12
    Rep Power
    8

    Default

    Quote Originally Posted by phoenix View Post
    Use zmmailbox, does this post give you a pointer?
    Yes, looks good, thanks. Will test once there are a few emails in there

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Errors because of Deffered emails
    By mansuper in forum Administrators
    Replies: 0
    Last Post: 11-20-2006, 04:08 PM
  2. Deleting Duplicate Emails
    By dagar in forum Administrators
    Replies: 2
    Last Post: 11-17-2006, 11:12 AM
  3. Deleting emails before a particular date
    By mansuper in forum Zimbra in Education
    Replies: 6
    Last Post: 11-16-2006, 02:57 PM
  4. Replies: 1
    Last Post: 12-15-2005, 10:05 AM
  5. emails don't show up in inbox in browser
    By pstelzer in forum Installation
    Replies: 10
    Last Post: 12-13-2005, 10:21 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
  •