[TriLUG] handy procmail recipe for spam

Benjamin Reed ranger at befunk.com
Wed Jan 22 10:38:14 EST 2003


So I use spamassassin, but sometimes stuff slips through, so I augment 
it some with my own procmail recipes sending things to /dev/null.  I 
started worrying that I went a bit procmail happy and had stuff that 
might somehow not be spam (people sending an e-mail with a joke subject, 
things like that... oh, and when I order porn, of course ;).

So I found a procmail recipe for bouncing e-mails rather than 
/dev/null'ing them, and cleaned it up and tweaked it to look like the 
bounces from postfix.  If anyone is interested in using it, I've 
attached it to this e-mail.  Basically all you do is edit the mail host 
at the top of the file (I set it manually since it's different from my 
hostname, otherwise you can just put ${HOST} in instead), and then set 
BOUNCETHIS=yes inside a procmail rule if you want the e-mail to bounce:

  :0
  * ^From:.*microsoft.com
  { BOUNCETHIS=yes }

...and include this procmail recipe at the end of your .procmailrc:

  INCLUDERC=$HOME/procmailrc-spambounce

...and you should be all set.  I'm going to look into taking the headers 
that come out of spamassassin and use those to trigger a bounce 
automatically too.  Shouldn't be hard, just haven't looked at it yet.

Thought this would be interesting to you folks...  =)




More information about the TriLUG mailing list