Note: Pair has now integrated Spam Assassin into their systems, which makes this info sort of pointless. -Luke
I set up SpamAssassin on my shared account at pair in a way that takes advantage of procmail's ability to have command line arguments passed to it (man procmail and check out the -a flag). In this way, I can easily enable spam filtering for selected mailboxes and forward recipes. Here's what I did:
man procmail
Installed SpamAssassin 2.44 to
/usr/home/USERNAME/local/usr /usr/home/USERNAME/local/etc
/usr/home/USERNAME/procmail/spam-forward.rc #LOGFILE=procmail.log #VERBOSE=yes #check messages under 200K to score them for spam-likeliness :0fw: spamassassin.lock * < 200000 | /usr/home/USERNAME/local/usr/bin/spamassassin #forward messages to the passed in email address :0 !$1
/usr/home/USERNAME/procmail/spam-forward.rc
/usr/home/USERNAME/procmail/spam-deliver.rc #LOGFILE=procmail.log #VERBOSE=yes #LOGABSTRACT=1 DEFAULT=/usr/boxes/USERNAME/$1/$2 EXITCODE=99 #check messages under 200K to score them for spam-likeliness :0fw: spamassassin.lock * < 200000 | /usr/home/USERNAME/local/usr/bin/spamassassin #the message will be delivered to the appropriate mailbox via the 'DEFAULT' variable
/usr/home/USERNAME/procmail/spam-deliver.rc
To filter mail for a forward recipe (mail to john@doe.com should be spam filtered and then forwarded to johndoe@someisp.net), I created the following file:
/usr/home/USERNAME/.qmail-doe:com-john |preline /usr/local/bin/procmail -ajohndoe@someisp.net ~/procmail/spam-forward.rc
/usr/home/USERNAME/.qmail-doe:com-john
For an address to deliver using a local mailbox (jane@doe.com is configured as a POP account via the ACC), I created the following file:
/usr/home/USERNAME/.qmail-doe:com-jane |preline /usr/local/bin/procmail -adoe.com -ajane ~/procmail/spam-deliver.rc # MAILBOX doe.com@jane@jane |preline -f bouncesaying 'Message rejected by mailbox due to space constraints.' /usr/local/libexec/virtual.local -f ${SENDER:-${USER:-UNKNOWN}} -L 35M -P 5M USERNAME/doe.com/jane
/usr/home/USERNAME/.qmail-doe:com-jane
You may be able to create these .qmail files using the ACC instead, in which case the file will automatically be created in /var/rules/USERNAME/
/var/rules/USERNAME/
To be clear, this setup results in all mail going to the same place, but some of it being processed by spamassassin, making it easier to filter into a junkmail folder in your mail client.
Hope this helps you out.