Tuesday, December 19, 2006

maildir housekeeping


Takatsugu had problems with his maildir and lost a bunch of mail. This reminded me of my little script that keeps my maildirs at a reasonable small size. I let run over my maildirs every night. It removes duplicate mails first and then moves all mails that are older then 30
days and not part of an active thread into a $maildirname.attic maildir.

I invoke it like this on my mail server in my user's crontab

@daily ~/src/pack_maildir.pl --maildir=~/Maildir --dir=. $(find ~/Maildir -maxdepth 1 -mindepth 1 -type d -not -name '*.attic' -not -name 'tmp' -not -name 'new' -not -name 'cur' -not -regex '.*Trash.*' -not -regex '.*Trash.*' -not -name '.SENT' -not -name '.Sent' -not -name '.DRAFTS' -not -name '.Drafts' -not -name '.virus' -not -name '.merkwurdiges' -name '.*' -printf "--dir=\%f ")

and duplicate the maildirs from there to my working machines with offlineimap.

This setup is orthogonal to spam protection, however. Apropos spam: According to my munin spamstats i get a magnitude more spam then ham nowerdays.

0 Comments:

Post a Comment

<< Home