Spamassassin Troubleshooting

Spamassassin Milter Testing

Greylisting must be disabled on the domain you are sending to for this test to work.

To test the Spamassassin Milter, it is necessary to send a Gtube test spam email using the command below (Replacing emailonserver@example.com with a real email account on the server). If the Anti-spam is working correctly you will see it listed in the maillog and in Warden log under Warden -> Logs -> Spam Log. While testing, note that Gtube test email gives +1000 scores to spam. So, even if a mailbox is in the whitelist, mail still be detected as spam because whitelisted email gets -100 scores.

Centos / RHEL / CloudLinux

echo "XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X" | mail -S smtp=localhost -r sender@example.com -s "Spam test example" emailonserver@example.com

Debian / Ubuntu

apt-get install s-nail
echo "XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X" | s-nail -S smtp=localhost -r sender@example.com -s "Spam test example" emailonserver@example.com

Restarting Spamassassin

Centos / RHEL / CloudLinux 7 (systemd)

// restart spamd
systemctl restart spamassassin.service 

// restart spamass-milter
systemctl restart spamass-milter.service 

Centos / RHEL / CloudLinux 6 (sysvinit)

// restart spamd
/etc/init.d/spamassassin restart

// restart spamass-milter
/etc/init.d/spamass-milter restart

Debian / Ubuntu

// restart spamd
/etc/init.d/spamassassin restart

// restart spamass-milter
/etc/init.d/spamass-milter restart

Debug Spamassassin

RHEL / Centos

spamassassin -D < /usr/share/doc/spamassassin-<version number>/sample-spam.txt

Debian / Ubuntu

spamassassin -D < /usr/share/doc/spamassassin/examples/sample-spam.txt

Debug a specific Spamassassin plugin

RHEL / Centos

spamassassin -t -D razor2 < /usr/share/doc/spamassassin-<version number>/sample-spam.txt

Debian / Ubuntu

spamassassin -t -D razor2 < /usr/share/doc/spamassassin/examples/sample-spam.txt

View any missing Perl modules required by Spamassassin

spamassassin -D --lint 2>&1 | grep -i failed