Volker Maximillian Koch, Zurich, Switzerland

Home Resume Information Search Contact

Procmail and SpamAssassin Tips

 

Problem

At D-ITET, SpamAssassin runs in "daemon mode global", which means that no personal rules can be used.

 

Solution

Here is a way to check email headers and bodies for spam strings using Procmail.

.procmailrc file:


SHELL=/bin/sh
MAILDIR=$HOME/Mail
INCLUDERC=/usr/pack/spamassassin-3.0.0-ds/procmail.inc
EMAIL_ADDRESS=???@ee.ethz.ch


# if the email has a spamassassin score greater than 10,
# delete it immediately

:0
* ^X-Spam-Status: .*, score=([1-9][0-9]\.|[0-9][0-9])
/dev/null


# if the email is spam according to spamassassin,
# move it to the spam folder

:0
* ^X-Spam-Status: Yes
spam


# check for spam strings only if
# spamassassin's score is anything over 0.
# this is to avoid filtering emails out
# that are on the white lists in
# /home/koch/.spamassassin/user_prefs.
:0
* ^X-Spam-Status: .*, score=([0-9]\.|[0-9][0-9])
{
   # check body and header of emails
   :0 BH
   # set initial score to -500
   * -500^0
   # add 501 if string occurs (not case sensitive)
   * 501^0 C_I_A_L_I_S
   * 501^0 commercia\|ization
   * 501^0 Miracle protein to help your family
   * 501^0 Japanese Original Urabon Shop. 18 and UP only
   {   
      # put email in spam folder if
      # score is greater than zero

      :0
      spam
   }
}


More information

 

10/2006