Spam is nothing new. We all know about it, because nearly every mailbox belonging to anyone with an @ in their email address gets it. While there are many ways to deal with spam, many are next to worthless, or impossible to keep current. However, as I'll demonstrate on tonight's show,
SpamAssassin might be the answer to your prayers. As with the other programs I talk about, it's for Linux and it's free.
SpamAssassin has reduced my daily spam load to about four or five unsolicited messages, which is something considering I normally get around 200 or so a day. Even better, and what convinced me to feature the program, is that one spam-filled week, SpamAssassin caught something like 2,000 spams, with only two false positives.
How to get it
It's easy. Under Red Hat, simply type in "up2date -i spamassassin", or you can get it from the
SpamAssassin site. This will install it onto your machine and then it will be available for use. The only other requirement is that you have a current, working Perl installation, something most distributions have as standard equipment.
Set it up
The easiest way to integrate SpamAssassin is via procmail. Procmail is a mail-processing application included with Red Hat. Procmail makes it very easy to do things like autofile mail into different folders. It's quite powerful, and we'll use it to pipe the incoming mail through SpamAssasin and do a simple "spam or not" test to the incoming mail.
To do this, we'll add a line that looks like this to procmail. Instructions on how to do this can be found here on the
SpamAssassin website. A good generic procmail recipe looks like this:
# more spam
:0fw
| /usr/bin/spamassassin -a -P
:0:
* ^X-Spam-Status: Yes
junk
This will dump an email into a junk folder if SpamAssassin thinks it's spam. I go weekly into this junk folder and do a cursory search for false positives (searching for TechTV, Linux, and a few other keywords). I get about 200 spams a day, and I've decided it's OK to miss an email now and then instead of spending my time dealing with spam.
Customize SpamAssassin
In the .spamassassin/user_prefs file there is a place for you to choose how sensitive you want SpamAssassin to be to incoming spam. If you want to be very safe you should set it to a high value such as 9 or 10, but if you want it to classify
many emails as spam, set it to something like 3 or 2 (not recommended). Also, if you worry about certain people being caught up in SpamAssassin's filters, like friends from Hotmail and other free email systems that are spam magnets, you can add a line like "Whitelist = blah@hotmail.com" to your user_prefs file. There is a document online about how to customize SpamAssassin
here.
Keep it up to date
It's worth keeping all of your software up to date, and SpamAssassin is no different. I recommend using your distributions packaging system to avoid having to do it manually. In Red Hat you can easily update your packages using up2date -u (or via apt-get in Debian).
That's it! SpamAssassin isn't perfect. It's not the easiest tool to install and it does call a false positive now and again, but that said I think it's the best tool developed in the fight against spam. Finally, any questions viewers might have can be sent to me at
chris@dibona.com (and read
my faq). Thanks for watching and reading.