This is the spam-filtering procmail script I currently use.

procmailrc:
Sample procmailrc that calls up procvars and spamcheckrc Edit this to suit your own needs, and store it as $HOME/.procmailrc
procvars:
Personalisations to suit the end-user. Includes your email addresses and details of mailing lists and other people you may receive BCC'ed mail from. Put it in directory $HOME/.nospam
spamcheckrc:
The spam filter itself. Probably doesn't need editing. Put it in $HOME/.nospam
rcvdrc:
Subroutine used to examine a single Received: header. Shouldn't need editing. Put it in $HOME/.nospam
spamscore:
Script to evaluate the overall "spam score" of a mail item. The bigger the number, the more likely it's spam. Adds up the scores in the X-Reject: headers added by spamcheckrc. Put it somewhere in your PATH, e.g. $HOME/bin
spamdomain:
Script to evaluate the hostname of the most heavily advertised site in a message. The name is tested for known spammer signs. Put it somewhere in your PATH, e.g. $HOME/bin
payload:
Decides what to do with the message based on the score. I deliver mail with scores <50 normally, mail with scores 50-99 in folder likely-spam as well as delivering it normally, and mail with scores 100+ is just delivered to folder junkmail.
Paul Howarth <paul@city-fan.org>
[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[TXT]payload2000-11-24 00:00 204  
[TXT]spamscore2006-07-04 12:41 231  
[TXT]procmailrc2001-10-11 08:26 1.0K 
[TXT]spamdomain2006-07-04 12:41 1.3K 
[TXT]README.txt2001-12-11 15:28 1.5K 
[TXT]procvars2003-09-24 10:41 1.5K 
[TXT]rcvdrc2006-07-04 12:41 5.1K 
[TXT]spamcheckrc2006-07-04 12:41 89K