[CentOS] Good book on setting up procmail/spamassassin?

Thu Oct 13 19:47:46 UTC 2005
Dan Pritts <danno at internet2.edu>

On Wed, Oct 12, 2005 at 01:33:10PM -0700, Preston Crawford wrote:
> >Yes, there is a section titled "Invoking SpamAssassin with procmail".
> 
> Thank you! Much appreciated!

i can well believe that it would be more complicated when using
fetchmail, but the short answer to invoking spamassassin from procmail
is to put something like this in your .procmailrc:

	:0 fw
	* < 256000
	| /usr/local/bin/spamc

the fw means the recipe is a filter, and that procmail needs to
wait for it to finish.

the < 256000 refers to the message size in bytes.  anything bigger
will be bypassed.

piping to spamc is appropriate if you are running spamd on your system,
which you probably want to do (see hte spamassassin web site and/or
docs for the quick description of how to do this).  Doing this makes
spamassassin run as a daemon so that each instance of spamassassin does
not have to run all the initialization code.  

for testing, you could replace it with a simple call to "spamassassin"
instead of "spamc".  

While i'm talking procmail, here's my favorite recipe:

	# weed out duplicate messages, first thing
	:0 Wh: msgid.lock
	| formail -D 8192 msgid.cache

Put this at the top of your procmailrc and you'll never see two copies
of the same message again, as long as they have matching message-ids.  

danno
--
dan pritts - systems administrator - internet2
734/352-4953 office        734/834-7224 mobile