Introduction
If the SpamAssassin installation becomes corrupt, SpamAssassin will need to be reinstalled.
Procedure
- Start by determining the package name of the installed version of SpamAssassin. The package name is specific to the version of Perl used by cPanel:
[root@server ~]cPs# rpm -qa|grep -i spam
cpanel-perl-532-mail-spamassassin-3.004004-9.cp1198.x86_64 - Remove the cPanel SpamAssassin RPM:
[root@server ~]cPs# rpm -e --nodeps cpanel-perl-532-mail-spamassassin
Removed symlink /etc/systemd/system/multi-user.target.wants/spamd.service.
warning: /etc/mail/spamassassin/v320.pre saved as /etc/mail/spamassassin/v320.pre.rpmsave
warning: /etc/mail/spamassassin/local.cf saved as /etc/mail/spamassassin/local.cf.rpmsave - Rename the old files to backups:
mv /usr/local/cpanel/3rdparty/bin/spamd{,.backup.$(date +%F_%R)}
mv /usr/local/cpanel/3rdparty/bin/spamc{,.backup.$(date +%F_%R)}
mv /usr/local/cpanel/3rdparty/bin/sa-learn{,.backup.$(date +%F_%R)}
mv /usr/local/cpanel/3rdparty/bin/spamassassin{,.backup.$(date +%F_%R)}
mv /usr/local/cpanel/3rdparty/bin/spamd{,.backup.$(date +%F_%R)}
mv /usr/local/cpanel/3rdparty/bin/spamc{,.backup.$(date +%F_%R)}
mv /usr/local/cpanel/3rdparty/bin/sa-learn{,.backup.$(date +%F_%R)}
mv /usr/local/cpanel/3rdparty/bin/spamassassin{,.backup.$(date +%F_%R)}
mv /etc/mail/spamassassin{,.backup.$(date +%F_%R)}
- Reinstall SpamAssassin.
/scripts/check_cpanel_pkgs --fix