Mailing List Archive

[SpamAssassin Wiki] New: ProcmailToForwardMail
Date: 2004-06-20T14:48:39
Editor: 63.203.206.124 <>
Wiki: SpamAssassin Wiki
Page: ProcmailToForwardMail
URL: http://wiki.apache.org/spamassassin/ProcmailToForwardMail

Page written by dan@dankohn.com based on <http://www.dankohn.com/archives/00032>

New Page:

= How do I use SpamAssassin with procmail to forward mail and to Bayes training? =

This procmail script is designed for people who have their mail forwarded through a server (e.g, example.com) but then read their mail on a non-publicized account on a different server (e.g., privateaddress@example.net). This is quite common for folks who have a vanity domain name but then read their mail through an office Exchange server, home DSL email account, etc. Note that after logging into the server, you can find the path for spamassassin by typing {{{which spamassassin}}}.

{{{

#Uncomment the following lines and use tail -f procmail.log to debug
#LOGFILE=$HOME/procmail.log
#VERBOSE=yes
#LOGABSTRACT=all

# Feed redirected spam to sa-learn

:0
* ^To:.*spam@example.com
* < 256000

{
:0c: spamassassin.spamlock
| sa-learn --spam

:0
mail/spam
}

# Send all other mail through SpamAssassin

:0fw: spamassassin.lock
* < 256000
| /usr/bin/spamassassin


# Mail that is very likely spam (>10) can be saved on the server
# (not forwarded), of by moving the # down one line, even dropped
# on the floor. Note that dropping mail on the floor is a *bad*
# idea unless you really, really believe no false positives will
# have a score great than 10. If you want all mail forwarded,
# just add #'s in front of each of these lines:

:0
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
#/dev/null
mail/tenplusspam


:0 # All spam with a score less than 10
! privateaddress@example.net # Forward mail to my non-publicized address

}}}