Ryan Haggerty b909ac
# SpamAssassin sample procmailrc
Ryan Haggerty b909ac
#
Ryan Haggerty b909ac
# Pipe the mail through spamassassin (replace 'spamassassin' with 'spamc'
Ryan Haggerty b909ac
# if you use the spamc/spamd combination)
Ryan Haggerty b909ac
#
Ryan Haggerty b909ac
# The condition line ensures that only messages smaller than 250 kB
Ryan Haggerty b909ac
# (250 * 1024 = 256000 bytes) are processed by SpamAssassin. Most spam
Ryan Haggerty b909ac
# isn't bigger than a few k and working with big messages can bring
Ryan Haggerty b909ac
# SpamAssassin to its knees.
Ryan Haggerty b909ac
#
Ryan Haggerty b909ac
# The lock file ensures that only 1 spamassassin invocation happens
Ryan Haggerty b909ac
# at 1 time, to keep the load down.
Ryan Haggerty b909ac
#
Ryan Haggerty b909ac
:0fw: spamassassin.lock
Ryan Haggerty b909ac
* < 256000
Ryan Haggerty b909ac
| spamassassin
Ryan Haggerty b909ac
Ryan Haggerty b909ac
# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
Ryan Haggerty b909ac
# false positives according to rules/STATISTICS.txt). Let's put them in a
Ryan Haggerty b909ac
# different mbox. (This one is optional.)
Ryan Haggerty b909ac
:0:
Ryan Haggerty b909ac
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Ryan Haggerty b909ac
almost-certainly-spam
Ryan Haggerty b909ac
Ryan Haggerty b909ac
# All mail tagged as spam (eg. with a score higher than the set threshold)
Ryan Haggerty b909ac
# is moved to "probably-spam".
Ryan Haggerty b909ac
:0:
Ryan Haggerty b909ac
* ^X-Spam-Status: Yes
Ryan Haggerty b909ac
probably-spam
Ryan Haggerty b909ac
Ryan Haggerty b909ac
# Work around procmail bug: any output on stderr will cause the "F" in "From"
Ryan Haggerty b909ac
# to be dropped.  This will re-add it.
Ryan Haggerty b909ac
:0
Ryan Haggerty b909ac
* ^^rom[ ]
Ryan Haggerty b909ac
{
Ryan Haggerty b909ac
  LOG="*** Dropped F off From_ header! Fixing up. "
Ryan Haggerty b909ac
  
Ryan Haggerty b909ac
  :0 fhw
Ryan Haggerty b909ac
  | sed -e '1s/^/F/'
Ryan Haggerty b909ac
}