# .procmailrc will move spam flagged by spamassassin into a spam directory, and delete spam older than 30 days. If mail fails, it is assumed mailbox quota is full. # Written by Marcus Sykes @ blog.netweblogic.com - ask@netweblogic.com MAILDIR = /var/qmail/mailnames/$1/$2/Maildir SHELL = /bin/sh SPAMDIR = $MAILDIR/.Spam/ #SUCCESSFUL DELIVERY :0 { #SPAM HANDLING :0 * ^X-Spam-Status: Yes.* { #Delete spam older than 30 days :0 * ? test -d $SPAMDIR && find $SPAMDIR/new -mtime +30 -exec rm {} \; && false { } #If this email account doesn't have a spam folder, don't use deliverquota this one time, very important otherwise you get permission problems.... :0 * !? test -d $SPAMDIR $SPAMDIR #Place in Spam Directory :0 EW * ^X-Spam-Status: Yes.* | /usr/bin/deliverquota "$SPAMDIR" } #Let the rest in :0 EW | /usr/bin/deliverquota "$MAILDIR" } #BOUNCES :0 e { LOG = "User mailbox is full" EXITCODE = '' TRAP = 'exit 77;' }