Re: [exim] Auto Purge of specific mail

Top Page
Delete this message
Reply to this message
Author: Michael Haardt
Date:  
To: exim-users
Subject: Re: [exim] Auto Purge of specific mail
On Thu, Mar 26, 2009 at 10:15:37AM +1100, Ted Cooper wrote:
> If you use Maildir format, easy using tools available on the system.
>
> You may blow out the command line length with this depending on how many
> domains and users you have - to get around this you might need a
> separate program that iterates into each of the directories before
> running ...
>
> find /path/to/mailroot/*/*/.SPAM -daystart -mtime +60 -exec rm -R {} \;


Been there, tried that, and failed. There are a couple problems with this
approach:

o find traverses the entire file system, including directories without
new mail compared to the last scan.
o find does not scale, it works sequentially and makes no use of the
parallel I/O capacity a RAID offers.
o While sounding intuitive at first, because you are used to expire
things in the real world after a given time, applied to mail it is
not. 60 days of spam can be all or nothing, depending on the rate.
It is more useful to set a "folder quota", as odd as it may sound at
first. find is of no help there.

If you use maildir, I can offer a patch for the last. It uses a file
named "maildirkeep" inside each folder, that specifies how much to keep at
most, wiping out anything else on delivery. While being useful for spam,
it is even more useful for folders with newsletters, or a global backup
folder. Did your "todo" folder ever get too full? Here is the answer. :-)

Michael