Updating to SpamAssassin 3.4.2 on Plesk Onyx running on Centos 7
So, SpamAssassin was just recently updated to v3.4.2 after a number of years of no updates. And, as I like new things - of course i would update. But after digging around in Plesk, and then also dropping down to the command line - I discovered it was not going to be a simple update. So of course I jump on DuckDuckGo to look for a solution. this is the thread I found, which was almost exactly what I needed: https://talk.plesk.com/threads/spamassassin-update-from-3-3-1-to-3-4-1.337266/.
Modifying the instruction set for Centos 7
Super easy, all I really needed to do was find a suitable src.rpm, and install a few extra dependencies. So here we go, my updated workflow for getting SpamAssassin running on a Centos 7 Plesk Onyx Server.
Installing and updating dependencies
After opening an ssh session to my server, the dependencies are installed, and perl is updated:
yum install rpm-build openssl-devel gcc make perl-Geo-IP perl-Mail-SPF perl-Net-CIDR-Lite
yum update perl
yum install perl-Test-Simple
Downloading and compiling spamassassin
I found a suitable rpm here: https://rpms.remirepo.net/rpmphp/zoom.php?rpm=spamassassin - then downloaded, and used it to compile for Centos 7.
wget https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/source/tree/Packages/s/spamassassin-3.4.2-3.fc30.src.rpm
rpmbuild --rebuild spamassassin-3.4.2-3.fc30.src.rpm
Updating Spamassassin
Now its just a matter of upgrading the current version:
rpm -Uvh /root/rpmbuild/RPMS/x86_64/spamassassin-3.4.2-3.el7.x86_64.rpm
And checking that it is really updated:
spamassassin -V
Fixing a connection issue with spamd
While everything appeared to be working, when i checked the /var/log/maillog
, I saw a number of following errors:
spamc[6785]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
So back to DDG, and I found out I needed to add the following: -d 127.0.0.1
to my /etc/mail/spamassassin/spamc.conf
file.
I also ran into an issue with spamassassin crashing, and this was fixed by editing the spamd startup options in the following file /etc/sysconfig/spamassassin
to look like this:
# Options to spamd
SPAMDOPTIONS="--helper-home-dir=/var/qmail --max-children=1 --nouser-config --username=popuser"
# SPAMDOPTIONS="--daemonize --helper-home-dir=/var/qmail --max-children=1 --nouser-config --username=popuser"
Restart SpamAssassin in Plesk
This is a breeze. All that’s needed is to hit the restart button for SpamAssassin on the Tools & Settings > Services Management
tab.
Update Spamassassin version number in Plesk
Now theres only one thing left to do, and that is to refresh the version number on the Tools & Settings > Server Components
tab. After hitting the refresh button, Plesk shows the updated SpamAssassin version!