[Dovecot] Automatic Folder Expiry (plugin?)

Troy Engel tengel at fluid.com
Thu Feb 1 17:58:02 UTC 2007

Mick T wrote:
> I have around 5000 mailboxes on local SCSI drives, but yeah I nice -20  
> the script, and run early in the morning. It doesn't take too long to run

Cool, thanks. (sorry about the Mike T instead of Mick T in the other 
response, oops) I found that I get a nice speed boost by using a bit 
more bash-fu with find's target, since my mailboxes are NFS I want 
tailor to what I know we have. Since all mailboxes are /home/X/XXXX/ 
(e.g. /home/t/tengel/) I am going with:

find /home/*/*/ -regex '.*/Maildir/\.Junk/\(cur\|new\)/.*' -type f 
-ctime +14 -exec rm -f '{}' \;

I ran a quick test using some ls -l action instead of rm to get a speed 
test idea:

# time find /home/*/*/ -regex '.*/Maildir/\.Junk/\(cur\|new\)/.*' -type 
f -ctime +7 -exec ls -l '{}' \; > results.log

real    23m15.837s
user    0m54.882s
sys     1m22.567s

That'll do! Not the fastest, but it works. :)

Troy Engel | Systems Engineer
Fluid, Inc | http://www.fluid.com

More information about the dovecot mailing list