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:

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: - then downloaded, and used it to compile for Centos 7.

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 failed, retrying (#1 of 3): Connection refused

So back to DDG, and I found out I needed to add the following: -d 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.

Restarting SpamAssassin in Plesk Restarting SpamAssassin in Plesk

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!

Updating SpamAssassin version number in Plesk Onyx Updating SpamAssassin version number in Plesk Onyx