My Procmail Mail Filtering Configuration

I use procmail in combination with spamassassin and bogofilter (a simple bayesian spam filter). Here’s a short list of all my procmail recipes, maybe someone can put them to use.


$HOME/.procmailrc :
[geshi lang=nsis]COMSAT=no
MAILDIR=$HOME/Maildir/
PROCDIR=$HOME/.Procmail/
FGREP=/bin/fgrep
YEARMONTH=`date +%Y.%m`
## uncomment VERBOSE to enable debug logging
# VERBOSE=yes
## log everything to procmail.YYYYMM.log
LOGFILE=$HOME/procmail.$YEARMONTH.log
## save a copy of every mail to Archive.YYYYMM
:0c:
.Archive.$YEARMONTH/
## extract FROM header to $FROM variable
:0
* ^From:\/.*
{
FROM = “$MATCH”
}
## extract TO header to $TO variable
:0
* ^To:\/.*
{
TO = “$MATCH”
}
# I don’t read Chinese, Japanese and Korean; throw away
INCLUDERC=$PROCDIR/foreignchars.rc
# I get a lot of false delivery notifications; move to separate dir
INCLUDERC=$PROCDIR/deliverynotifications.rc
# do not filter mail by friends
INCLUDERC=$PROCDIR/whitelist.rc
# various filters for university mails
INCLUDERC=$PROCDIR/uni.rc
# filters (wanted) mailing lists
INCLUDERC=$PROCDIR/mailinglists.rc
# first run bogomail
INCLUDERC=$PROCDIR/bogofilter.rc
# then spamassassin
INCLUDERC=$PROCDIR/spamassassin.rc
[/geshi]