Filtering Spam with qmail and SpamAssassin on Red Hat Fedora 2
July 16, 2004 by Fernando Duran
I have a customer with several web sites hosted on a dedicated server.
The server uses qmail as MTA and I wanted to install SpamAssassin to filter out spam.
Aftert a little search, I didn't find a clear documentation of how to connect SpamAssassin with qmail. Two useful pages I found were:
How to use Spamassassin together with Qmail and SpamAssassin with qmail / Vpopmail
I wanted to filter on a per-account basis and I was having some problem with the recipe from the 1st page. So basically I adapted the information and here's what it worked for me:
- I installed SpamAssassin, more or less like explained in the 2nd page
- I edited the file /etc/mail/spamassassin/local.cf
- I checked with a spam example (save a spam email with full headers) that it works from the command line: spamc < spam.txt
- I downloaded and installed safecat (contains the maildir tool)
by the way, it gives an error warning when maildir is executed but it works. - As mail user ("popuser") I edited the .qmail file of the account ("webmaster") located at /var/qmail/mailnames/domainhere.com/webmaster/.qmail with the following:
| spamc |maildir ./Maildir/ - I checked that it was working: cat spam.txt | spamc |maildir ./Maildir/
- I (re)started SpamAssassin: /etc/init.d/spamassassin restart

