After upgrading from Centos 7 to AlmaLinux/CoundLinux 8 you should run the commands below to get Warden fully functional again:
1. First re-run the Warden installer from the command line. It will install any missing packages for the new OS version.
/usr/local/psa/admin/bin/modules/warden/install.sh
2. Reset the Amavis and SpamAssassin database credentials. This will change the DB connection string used to the new perl-DBD-MariaDB driver used on AlmaLinux/CoundLinux 8+. (The old perl-DBD-MySQL driver used by Centos 7 cannot be used as it has a bug which will cause all mail scanned by Amavis to be flagged as spam):
warden --task=contentfilter:contentfilter --default=yes --reload=yes
warden --task=antispam:learning --default=yes --reload=yes
3. Delete the legacy Perl module List::Util that was installed using Cpan on Centos 7:
rm -rf /usr/local/share/perl5/List
4. If you are using the SH plugin then you need to use the commands below to update the SH plugin from SpamAssassin 3.4 to SpamAssassin 4.0 .
// Re-enable the SH plugin. This will upgrade the SH plugin to the new version
warden --task=antispam:plugins --SH=1 --reload=yes
// Set the SH API key and enable the HBL (replace XXXX with your real API key. Only enable the HBL if your key supports it). This will copy the new SH rules used by the new SH plugin version
warden --task=antispam:plugin:sh --sh_apikey='XXXXXXXXXXXXXXXXXXXXXXXX' --sh_hbl=1 --reload=yes