Configuring Spamassassin in Fedora Core 4

Spamassasin is a great antispam software that is available under the GNU license. It is free to dwonload and use. After much tinkering, downloading, and reading ton’s of articles on the internet, I almost gave up trying to get it working.

I have a Fedora Core 4 server with sendmail as the MTA for my email. I use Squirrelmail as the web client to access my emails. For the past many months I have started receiving an incredible amount of spam emails. It seems that I get approximately anywhere between 50-100 spams. Well since I am home on vacation this week, not really as I am house watching while my washroom is being reno. I have taken this opportunity to get spamassassin working on my server.

Firstly check to see if Spamassassin was installed and activated. I entered the command

# rpm -q spamassassin
spamassassin-3.0.3-4.fc4

Yes, I had version 3.0.3-4.fc4 installed.

To start spamassasin simply enter the below command

# service spamassassin start

Next, use yum to upgrade the version if it is available. In my case it found none.
# yum update spamassassin

Lastly activate antispam for an individual by following the below instruction.

To enable spamassassin, if you are receiving mail locally, simply add
this line to your /.procmailrc (eg. /home/andrew/.procmailrc):
INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc

To activate anti spam for all users:

Add the above line to /etc/procmailrc

Viola, now all the junk emails are marked with a subject line of [****SPAM****]. This makes it so much easier for me to scan quickly and delete.

I must say that it was very easy to install and active Spamassassin on Fedora Core 4. But it took me over a day to figure this out. I tried all sorts of help available on the internet but could not get it working. I gave up and tried installing Dspam another open source software which is also very good. But after I downloaded Dspam and then tried to complie it for my version of linux, I had trememdous challanges. I gave up on that and went back to trying to figure out how to get Spamassassin working. I am glad I did that as I now have it working. There si not much help you can find on the Frdora Project forum.

Well here is how I stumbled on the answer, just a simple solution. I was using the yum command to search for the spamassassin packag and the answer was right in front of my face. The result of the yum serach command displays the instruction to active spam filter. Below is the result.

# yum search spamassasin
Searching Packages:
Setting up repositories
Reading repository metadata in from local files
No Matches found
[root@morpheus dspam-3.8.0]# yum search spamassassin
Searching Packages:
Setting up repositories
Reading repository metadata in from local files

pyzor.noarch 0.4.0-9.fc4 extras
Matched from:
Pyzor is a collaborative, networked system to detect
and block spam using identifying digests of messages.
Pyzor is similar to Vipul’s Razor except implemented
in python, and using fully open source servers.

Pyzor can be used either standalone, or to augment the
spam filtering ability of spamassassin. spamassassin
is highly recommended.

exim-sa.i386 4.62-1.fc4 extras
Matched from:
Exim SpamAssassin at SMTP time – d/l plugin

spamass-milter.i386 0.3.1-3.fc4 extras
Matched from:
Sendmail milter for spamassassin
A Sendmail milter (Mail Filter) library that pipes all incoming mail
(including things received by rmail/UUCP) through the SpamAssassin,
a highly customizable spam filter.

sylpheed-claws-plugins-spamassassin.i386 2.6.0-1.fc4 extras
Matched from:
sylpheed-claws-plugins-spamassassin
Spamassassin plugin for sylpheed-claws
Spamassassin plugin for sylpheed-claws

amavisd-new.noarch 2.4.2-2.fc4 extras
Matched from:
Email filter with virus scanner and spamassassin support
amavisd-new is a high-performance and reliable interface between mailer
(MTA) and one or more content checkers: virus scanners, and/or
Mail::SpamAssassin Perl module. It is written in Perl, assuring high
reliability, portability and maintainability. It talks to MTA via (E)SMTP
or LMTP, or by using helper programs. No timing gaps exist in the design,
which could cause a mail loss.

spamassassin.i386 3.0.3-4.fc4 base
Matched from:
spamassassin
SpamAssassin provides you with a way to reduce if not completely eliminate
Unsolicited Commercial Email (SPAM) from your incoming email. It can
be invoked by a MDA such as sendmail or postfix, or can be called from
a procmail script, .forward file, etc. It uses a genetic-algorithm
evolved scoring system to identify messages which look spammy, then
adds headers to the message so they can be filtered by the user’s mail
reading software. This distribution includes the spamd/spamc components
which create a server that considerably speeds processing of mail.

To enable spamassassin, if you are receiving mail locally, simply add
this line to your ~/.procmailrc:
INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc

To filter spam for all users, add that line to /etc/procmailrc
(creating if necessary).
http://spamassassin.apache.org/

spamassassin.i386 3.0.6-1.fc4 updates-releasedMatched from:
spamassassin
SpamAssassin provides you with a way to reduce if not completely eliminate
Unsolicited Commercial Email (SPAM) from your incoming email. It can
be invoked by a MDA such as sendmail or postfix, or can be called from
a procmail script, .forward file, etc. It uses a genetic-algorithm
evolved scoring system to identify messages which look spammy, then
adds headers to the message so they can be filtered by the user’s mail
reading software. This distribution includes the spamd/spamc components
which create a server that considerably speeds processing of mail.

To enable spamassassin, if you are receiving mail locally, simply add
this line to your ~/.procmailrc:
INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc

To filter spam for all users, add that line to /etc/procmailrc
(creating if necessary).
http://spamassassin.apache.org/

spamassassin.i386 3.0.3-4.fc4 installed
Matched from:
spamassassin
SpamAssassin provides you with a way to reduce if not completely eliminate
Unsolicited Commercial Email (SPAM) from your incoming email. It can
be invoked by a MDA such as sendmail or postfix, or can be called from
a procmail script, .forward file, etc. It uses a genetic-algorithm
evolved scoring system to identify messages which look spammy, then
adds headers to the message so they can be filtered by the user’s mail
reading software. This distribution includes the spamd/spamc components
which create a server that considerably speeds processing of mail.

To enable spamassassin, if you are receiving mail locally, simply add
this line to your ~/.procmailrc:
INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc

To filter spam for all users, add that line to /etc/procmailrc
(creating if necessary).

I am going to monitor the accuracy of the anti spam, if it is accurate then I will simply configure spamassassin to drop all spams instead of delivering it to my users mailboxes.

19 Nov, 2007: Well it’s been some weeks and Spamassassin is doing a great job. Over 90% of spam are identified correctly. I simply configured it to drop all spam instead of just tagging the subject line. This should save me a lot of time manually deleting all junk mail. This is how i did it, I edited the /etc/mail/spamassassin/spamassasin-default.rc and added the below lines:

# Drop all spam emails to /dev/null
:0:
* ^X-Spam-Status: Yes
/dev/null

About Andrew Lin

Hi, I have always wanted to creat a blog site but never had the time. I have been working in Information Technology for over 15 years. I specialize mainly in networks and server technologies and dabble a little with the programming aspects. Andrew Lin

View all posts by Andrew Lin →