Here are some simple steps in debugging your SpamAssassin installation:

  • Run 'spamassassin --lint', especially if you just added anything to your *.cf files or a user_prefs file. Often times you might have something slightly wrong and either a) SpamAssassin stops parsing the file or b) it's just plain wrong and causing the error.
  • Run with '-D'. The debug output from spamassassin, sa-learn, spamd is sometimes very verbose, but it also gives you a large amount of data that can be very helpful. Often times debug is the only place to see what exactly is causing your error. When running spamd with -D you will see some initial startup activity, you can ignore this, it is just scanning a test message to help do the initial load of the perl modules.
  • Sometimes its necessary to output the SpamAssassin debug information to a file. This can be done by redirecting stdout to a file and then redirecting stderr to the same location. Run 'spamassassin -D --lint > test.log 2>&1'.
  • Speed issues: * spamassassin -D --lint 2>&1 | less* and look for any gaps in time
  • Failures: * spamassassin -D --lint 2>&1 | grep failed*
  • DNS related: * spamassassin -D --lint 2>&1 | grep dns:*
  • Shortciruit: * spamassassin -D --lint 2>&1 | grep shortcircuit:*
  • Bayes: * spamassassin -D --lint 2>&1 | grep bayes:*
    • If you are not seeing any BAYES rules hit in your logs/headers, make sure you have at least 200 ham and 200 spam tokens: * sa-learn --dump magic*

        0.000          0          3          0  non-token data: bayes db version
        0.000          0    2944470          0  non-token data: nspam
        0.000          0   12169738          0  non-token data: nham