Upgrading SpamAssassin on Fedora 4 server.

Download the lastet version of SpamAssassin version 3.2.5, the file name is Mail-SpamAssassin-3.2.5.tar.gz. You can get the latest version from spamassassin.apache.org.

In this step by step example I am upgrading SpamAssassin version 3.0.3-4.fc4 to 3.2.5 on my Fedora 4 server.

After you download the lastest version, build the rpm using this file, the command to do that is below.

sudo rpmbuild -tb Mail-SpamAssassin-3.2.5.tar.gz

This will create two files, perl-Mail-SpamAssassin-3.2.5-1.i386.rpm and spamassassin-3.2.5-1.i386.rpm in the folder /usr/src/redhat/RPMS/i386.

Install this file first with the following command,

rpm -i perl-Mail-SpamAssassin-3.2.5-1.i386.rpm

Uninstall Evolution first because it dependencies that relies on Spamassassin 3.0.3-4.fc4, otherwise you will receive an error when uninstalling SpamAssassin version 3.0.3. Evolution is an email client for Linux, similar to Outlook for Windows.

Uninstall in the following order:
rpm -e evolution-connector-2.2.2-5.i386
rpm -e evolution-devel-2.2.2-5.i386
rpm -e evolution-2.2.2-5.i386

Check to see whcih version of Spam Assassin is installed.

rpm -q spamassassin
spamassassin-3.0.3-4.fc4

To uninstall run this command.

rpm -e spamassassin-3.0.3-4.fc4

You will see this warning message.
warning: /etc/mail/spamassassin/spamassassin-default.rc saved as /etc/mail/spamassassin/spamassassin-default.rc.rpmsave

Confirm that SpamAssassin has been uninstalled.
rpm -q spamassassin
package spamassassin is not installed

Now install the new version of SpamAssassin.

rpm -i spamassassin-3.2.5-1.i386.rpm

Check to see if the installation was successful.
rpm -q spamassassin
spamassassin-3.2.5-1

Now copy this file that was renamed during the uninstallation of the previous version.
cp -i spamassassin-default.rc.rpmsave spamassassin-default.rc

If you are interested here is the contents of the file spamassassin-default.rc.
# send mail through spamassassin
:0fw
| /usr/bin/spamassassin
# Drop all spam emails to /dev/null
:0:
* ^X-Spam-Status: Yes
/dev/null
# send mail through spamassassin
:0fw
| /usr/bin/spamassassin
# Drop all spam emails to /dev/null
:0:
* ^X-Spam-Status: Yes
/dev/null

The final step is to start the SpamAssassin service.

service spamassassin start
Starting spamd: [ OK ]

If you wish you can now download and install the latest version of Evolution from projects.gnome.org/evolution. I may do that sometime, as I do not use it.

Well after I completed the above steps, it seems that SpamAssassin was not working. I then decided to read the documentation avaiable on the website. I guess I should have doen that first.

Anyhow, these are the steps I missed. Edit the file /etc/mail/spamassassin/local.cf.

Remove the comment (#) from these lines as shown below

# Add *****SPAM***** to the Subject header of spam e-mails
#
rewrite_header Subject *****SPAM*****

# Set the threshold at which a message is considered spam (default: 5.0)
#
required_score 8

# Use Bayesian classifier (default: 1)
#
use_bayes 1

# Bayesian classifier auto-learning (default: 1)
#
bayes_auto_learn 1

Then edit the file /etc/mail/spamassassin/spamassassin-default.rc, and add these lines if it’s not there.

# send mail through spamassassin
DROPPRIVS=yes

:0fw
| /usr/bin/spamassassin

Restart spamd.
service spamassassin restart

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 →