This is an old revision of the document!

DBMail Auto Deletion

The following SQL statement will mark messages older than 180 days as candidate for deletion (a job later taken on by dbmail-util -ay).

UPDATE dbmail_messages SET status = 2 WHERE physmessage_id NOT IN
     (SELECT physmessage_id FROM dbmail_datefield WHERE date_sub(curdate(), interval 180 day) < = datefield);

At this time, this appears to be compatible with the archiving strategy I've developed. The idea is to maintain 6 months of “online” mail since older messages will exist in the archive anyway.


Right now, the code above is mailbox-agnostic and will therefore, delete *all* mail in the database that is older than the defined number of days. At the moment, I'm still not sure I'll be using this strategy at all so I haven't decided how flexible I need to make it. resume writing services

dbmail_auto_delete.1311066411.txt.gz · Last modified: 2011/07/19 11:06 by robertsoncallista
DBMail is developed by Paul J Stevens together with developers world-wide