Setting up SpamAssasin on pair.com The first time I set up SpamAssassin, I had a hard time. So the second time I set it up, I sat down and logged the recipe. It went much easier this time. This recipe requires shell access, so ftp-only users are out of luck. It also assumes you're somewhat familiar with the Unix commandline environment, so it doesn't tell you how to edit files when logged in via ssh, etc. Make sure you have an ssh client installed (it's unsafe to log in via telnet). A good one for Windows is PuTTY (look for it on google). The one that comes with Cygwin is also good, but doesn't work terribly well when you try to use full-screen programs like text editors. In the following recipe, replace MYHOSNTAME with your domain name before the dot, replace COM with your domain name after the dot, and replace MYUSERNAME with your Pair.com login name. ==== Read The Doc First ======================================== 0. Review the following web pages briefly: http://www.pair.com/pair/support/tutorials/qmail.html http://www.procmail.org http://www.uwasa.fi/~ts/info/proctips.html#start http://www.spamassassin.org/doc.html === Configuring and testing procmail =========================== 1. Log in to www.MYHOSTNAME.COM via ssh 2. Create a text file named .procmailrc containing just the lines # Replace the word ZNORT with BLORT to test whether procmail is up :0 fwh | sed 's/ZNORT/BLORT/' # Forward the mail to my personal mailbox :0 !MYUSERNAME@pair.com That last line is important; it's what delivers the mail to your POP or IMAP account. If you had an old forward recipe, use the address you forwarded mail to here. (I use MYUSERNAME@pair.com here because I have my mail client pick up all my email from pair instead of from my ISP.) 3. Log in to the Pair.com account manager web site, https://acc.mypairaccount.com/acc/login.html and create a new filter recipe for one of your domains, to pass all mail through the filter /usr/local/bin/procmail If you had an old forward recipe, note its contents carefully, then delete it (the filter recipe will do what the old forward recipe did after it filters the mail through spamassassin.) 4. In your ssh session, check to see if that created the file /var/rules/MYUSERNAME/.qmail-MYHOSTNAME:COM-default containing the two lines # FILTER @MYDOMAINNAME /usr/local/bin/procmail |preline /usr/local/bin/procmail It may take 15 minutes for the file to appear. 5. Send yourself a test message with ZNORT in the subject line (not in the body). It should arrive changed to BLORT! Once it does, you can remove the silly lines # Replace the word ZNORT with BLORT to test whether procmail is up :0 fwh | sed 's/ZNORT/BLORT/' from your .procmailrc. === Installing SpamAsassin and hooking it up to procmail ================== 6. Review the Spamassassin installation instructions at http://www.spamassassin.org/dist/INSTALL and pay attention to the section "Installing SpamAssassin for Personal Use (Not System-Wide)" but ignore the part about .forward files, as pair.com uses qmail, and you already set up qmail to filter mail through procmail. In your ssh session to www.MYHOSTNAME.COM, download Spamassassin and install it according to those instructions, e.g. cd ~ wget http://www.spamassassin.org/released/Mail-SpamAssassin-2.43.tar.gz tar -xzvf Mail-SpamAssassin-2.43.tar.gz cd Mail-SpamAssassin-2.43 perl Makefile.PL PREFIX=~/sausr SYSCONFDIR=~/saetc make make install cd ~ 7. Tell procmail to run all mail through spamassassin by adding the lines :0fw | /usr/home/MYUSERNAME/sausr/bin/spamassassin to the ~/.procmail file you set up earlier. 8. Send yourself another test message. When you receive it, do "view message source" or look at the raw message; it should have the header "X-Spam-Status: No...". Congratulations, you've installed SpamAsassin on your pair.com account! === Mail client configuration ============================================ 9. Now create a "Spam" folder in your mail client, and a filter that looks for "Yes" anywhere in the header "X-Spam-Status" and moves it to the "Spam" folder. Watch that folder fill up with spam! === The End =============================================================