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

[DIR]Parent Directory  -
[TXT]README.txt11-Dec-2001 15:28 1.5K
[TXT]payload24-Nov-2000 00:00 204
[TXT]procmailrc11-Oct-2001 08:26 1.0K
[TXT]procvars24-Sep-2003 10:41 1.5K
[TXT]rcvdrc04-Jul-2006 12:41 5.1K
[TXT]spamcheckrc04-Jul-2006 12:41 89K
[TXT]spamdomain04-Jul-2006 12:41 1.3K
[TXT]spamscore04-Jul-2006 12:41 231

Apache/2.2.8 (Fedora) Server at www.city-fan.org Port 80