Rate this page del.icio.us  Digg slashdot StumbleUpon

How do I test if my anti-spam configuration works?

by

Solution:

There is a special feature supported by Spamassassin named the GTUBE (Global Test for Unsolicited Bulk Email).

It consists of a rule which recognizes the 68-bytes string which is sent in the email’s body. If the email goes through spamassassin, it will be detected as spam.

To test, send an email to a specific address, which has antispam rules configured. Enclose this 68-byte string:

XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X

This test is similar to the EICAR anti-virus test file for antivirus softwares.

contributed by Sebastien Aime

Red Hat’s customer service and support teams receive technical support questions from users all over the world. Red Hat technicians add the questions and answers to Red Hat Knowledgebase on a daily basis. Access to Red Hat Knowledgebase is free. Every month, Red Hat Magazine offers a preview into the Red Hat Knowledgebase by highlighting some of the most recent entries.

7 responses to “How do I test if my anti-spam configuration works?”

  1. functional bytes blog says:

    Funktionsfähigkeit von SpamAssassin testen

  2. Brian says:

    I guess that’s a better way than floating your address on the Net to test out your anti-spam s/w.

  3. Mojo says:

    This is nice, but it does NOT test whether a specific set of rules or any other specific feature of spamassasin is working. How do you test that?

  4. CyberKnight says:

    Mojo:

    This test lets you determine that Spamassassin is configured and working correctly. If you want to test a specific rule, you have to craft an email that triggers that rule, send it, and see if it catches it (and likewise craft one that doesn’t trigger the rule and make sure it goes through unmolested).

  5. Quinn Comendant says:

    Combined with the above the following will test the remaining functions of spamassassin:

    sudo -H -u root spamassassin -t -D –lint &1 | grep -v ‘dbg’

    Change “root” to the actual user that spamassassin or spamd runs as. Sudo runs spamassassin as this user so you can confirm your configuration files and log directories are readable and writable by that user.

    If you are running spamd/spamc you should test both of these as well.

    Test spamd by running it on the command line with the same options that are specified in your rc file, but add the -D option for debugging, and use the `sudo -H -u root` trick above (again, replacing “root” with the actual user that spamd will run as). You may need to stop any existing spamd processes. After testing, start spamd as normal before testing spamc.

    Test spamc with:

    spamc -R

  6. Quinn Comendant says:

    OH RATS this comment system fudged my examples by removing everything after the [left/right angle bracket symbol]. Here are the examples again, with [left angle bracket symbol] replaced with { and [right angle bracket symbol] replaced with } instead:

    sudo -H -u root spamassassin -t -D –lint { /path/to/example.email 2}&1 | grep -v ‘dbg’

    spamc -R { /path/to/example.email

  7. ea94f46d1cb2 says:

    ea94f46d1cb2

    ea94f46d1cb2a104d28b