How can I test that the Anti-spam and Anti-virus is working?

How to test SpamAssassin

Note: Greylisting must be disabled for the recipient domain before running these tests.

To test Anti-spam (SpamAssassin), 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):

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

If the Anti-spam is working correctly you will see it listed in the Warden log under 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.

How to test ClamAV

Note: Greylisting must be disabled on the server before running these tests.

To test Anti-virus(ClamAV), it is necessary to download the eicar test virus email and send it using the command below (Replacing emailonserver@example.com with a real email account on the server):

Centos / RHEL / CloudLinux:

wget http://www.eicar.org/download/eicar.com.txt
echo "TEST MESSAGE w/ ATTACHMENT" | mail -S smtp=localhost -r sender@example.com -s "A/V test example" -a eicar.com.txt emailonserver@example.com

Debian / Ubuntu:

apt-get install s-nail
wget http://www.eicar.org/download/eicar.com.txt
echo "TEST MESSAGE w/ ATTACHMENT" | s-nail -S smtp=localhost -r sender@example.com -s "A/V test example" -a eicar.com.txt emailonserver@example.com

If the Anti-virus is working correctly you will see it get blocked and it will be listed in the Warden log under Logs -> Virus Log.

  • gtube, Eicar, test
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Why isn't autolearning working for me (autolearn=no) ?

Lots of people seem to be confused by the "autolearn=no" statement in the default X-Spam-Status...

I get the a 502 gateway error when clicking on the application. How can I fix this?

This can usually be fixed by just restarting the Plesk interface:/etc/init.d/psa restart

How can I fix the error WARNING: Ignoring deprecated option AllowSupplementaryGroups after upgrading to ClamAV 1.00?

The AllowSupplementaryGroups option was deprecated in ClamAV 1.00. If this option is present in...

How can I fix the error: spamass-milter[27944]: Could not extract score from <> ?

When you look at your email log you see: spamass-milter[27944]: Could not extract score from...

How can I stop encrypted archives from being allowed though ClamAV?

For ClamAV 0.100 and belowUnder Warden -> Settings -> Scanning Settings -> Block...