-
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?
-
Use zmmailbox, does this post give you a pointer?
-
Quote:
Originally Posted by
phoenix
Use zmmailbox, does this
post give you a pointer?
Yes, looks good, thanks. Will test once there are a few emails in there