Results 1 to 3 of 3

Thread: Deleting old emails

Threaded View

  1. #1
    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 05:58 AM. Reason: reformatting, addition

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
  •