Corrin Lakeland <lakeland@cs.otago.ac.nz> [2002-08-30 12:46:30 +1200]: > Steps to get spamassassin working: > [...] > Set exim to call spamassassin on incoming messages, using spamd. > Write a rule in kmail that moves mail to spam if X-Spam-Status=yes > [...] > Personally I use exim -> procmail -> spamassassin, and I set kmail to access > mail via imaps, but you don't need that if you're happy writing filter rules I personally prefer the procmail way to call spamassassin instead of starting spamd. With spamd you have to remember to restart it when you change the rules and other issues. The install docs on the SA site are pretty good. Look there. Jump down to number 5 since with Debian you can avoid the previous steps and just run apt-get. apt-get install spamassassin http://spamassassin.sourceforge.net/dist/INSTALL 5. Create a .forward file in your home directory containing the below lines: "|IFS=' ' && exec /usr/bin/procmail -f- || exit 75 #user" 6. Edit or create a .procmailrc file in your home directory containing the below lines. If you already have a .procmailrc file, add the lines to the top of your .procmailrc file: :0fw | /usr/bin/spamassassin The above line filters all incoming mail through SpamAssassin and tags probable spam with a unique header. If you would prefer to have spam blocked and saved to a file called "caughtspam" in your home directory, instead of passed through and tagged, append this directly below the above lines: :0: * ^X-Spam-Status: Yes caughtspam 7. Now, you should be ready to send some test emails and ensure everything works as expected. First, send yourself a test email that doesn't contain anything suspicious. You should receive it normally, but there will be a header containing "X-Spam-Status: No". If you are only tagging your spam, send yourself an obvious spam mail and check to be sure it is marked as spam. If your test emails don't get through to you, immediately rename your .forward file until you figure out cause of the the problem, so you don't lose incoming email. Then you can test using these commands. zcat /usr/share/doc/spamassassin/sample-nonspam.txt.gz | spamassassin -Dt zcat /usr/share/doc/spamassassin/sample-spam.txt.gz | spamassassin -Dt I know you said 'Kmail'. But if you are using 'mutt', and others might be, then I recommend using the Maildir/ format mailboxes. In which case the syntax changes to this. cd $MAILDIR mkdir -p caughtspam/{cur,new,tmp} :0 * ^X-Spam-Status: Yes caughtspam/ Although not perfect Spamassassin is very good. Try it and you will like it. Bob
Attachment:
pgp92ihD0p9GG.pgp
Description: PGP signature