On Feb 19, 2007, at 2:55 AM, Dudi Goldenberg wrote:

Hi Karl,

is there something like the logclean-script for the quarantine?
i need something like "delete every mail older then x days", since my
users request it...

This is what I use, it relies on archivemail, apt-get install
archivemail
does it for u in Debian. :)



Archivemail uses the Date fields in the headers to find the date of the email.
This can be a problem with spam quarantines, since many
spam come with forged headers.
This will not delete all the spam in the quarantine that came in after x days.
It will delete mail x days after the Date header fields of the message.
(which can be in the future, in which case it may take years
before it is deleted)

The dspam webGUI uses the From line of the mbox to
display the date in the quarantine, so it may look confusing
if an email over 6 months is displaying in the quarantine
because the Date header is in the future.

I find it better to delete messages older that x days since delivery date.
mbox-purge, can use the From line in the mbox file. This will
delete messages x days from delivery date, not x days
after the Date headers say it came in.
It uses procmail locking, so you have to install procmail

http://www.argon.org/~roderick/mbox-purge
http://www.argon.org/~roderick/mbox-purge.html


Example to delete quarantine messages after 10 days from all users:

mbox-purge --eval 'time - delivery_time > 60*60*24*10' /var/dspam/ data/*/*/*/*.mbox


Daniel



Reply via email to