Upgrade Spamassassin In Qmail

Upgrade Spamassassin In Qmail

Go to the Spamassassin website and read the upgrade notes:

http://wiki.apache.org/spamassassin/UpgradeNotes

Download the software

cd /usr/local/src
wget http://www.mirrorservice.org/sites/ftp.apache.org/spamassassin/source/Mail-SpamAssassin-3.2.5.tar.gz

Get the md5 of the tarball

md5sum Mail-SpamAssassin-3.2.5.tar.gz

Compare the previous md5 with the one in Spamassassin's website

http://www.apache.org/dist/spamassassin/source/Mail-SpamAssassin-3.2.5.tar.gz.md5

Download and install

wget http://dag.wieers.com/rpm/packages/perl-HTML-Parser/perl-HTML-Parser-3.56-1.el4.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/perl-Net-DNS/perl-Net-DNS-0.63-1.el4.rf.i386.rpm
rpm -Uvh perl-HTML-Parser-3.56-1.el4.rf.i386.rpm
rpm -Uvh perl-Net-DNS-0.63-1.el4.rf.i386.rpm

Install rpmbuild

yum install rpm-build

Make an rpm

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

Make a backup of the config files

cp /etc/mail/spamassassin/local.cf /etc/mail/spamassassin/local.cf.spamassasin-3.0.2.`date +%d%b%g`

Install necessary packages

yum install perl-Archive-Tar

Uninstall the old spamassassin

rpm -e spamassassin-tools-3.0.2-1 spamassassin-3.0.2-1 perl-Mail-SpamAssassin

Install the rpms

rpm -Uvh /usr/src/redhat/RPMS/i386/spamassassin-3.2.5-1.i386.rpm /usr/src/redhat/RPMS/i386/perl-Mail-SpamAssassin-3.2.5-1.i386.rpm

Restore the original config file

mv /etc/mail/spamassassin/local.cf /etc/mail/spamassassin/local.cf.spamassasin-3.2.5.orig
cp /etc/mail/spamassassin/local.cf.spamassasin-3.0.2.`date +%d%b%g` /etc/mail/spamassassin/local.cf

Initialize the versions file and generate a new perlscanner database

cat /var/spool/qmailscan/qmail-scanner-queue-version.txt
setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -z
cat /var/spool/qmailscan/qmail-scanner-queue-version.txt
setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -g    (/var/qmail/bin/qmail-scanner-queue -g (for non setuid setups))

Check spamassassin version

spamassassin --version

Restart Qmail and SpamAssassin

qmailctl stop
qmailctl stat
qmailctl start
/etc/init.d/spamassassin restart
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License