Mimsy Were the Borogoves

Hacks: Articles about programming in Python, Perl, PHP, and whatever else I happen to feel like hacking at.

SpamAssassin 3.x configuration changes

Jerry Stratton, June 11, 2005

My service provider recently upgraded to SpamAssassin 3. Of course, it had to happen while I was out on vacation, so I had a few thousand spam messages waiting for me when I returned, messages that should have been filtered out. The problem is that a few of the rules that SpamAssassin uses have changed.

While the change from rewrite_subject to rewrite_header is documented on the SpamAssassin web site, I could find nowhere that describes how to replace the missing spam_level_char rule. That required serious digging.

These are the rules in my personal user_prefs file that needed to be changed for SpamAssassin 3.0.x.

rewrite_subject 1

This used to tell SpamAssassin to add something to the subject line to indicate spam. Normally, this is something like "***SPAM***". In SpamAssassin 3, the rule to turn on rewriting and to specify what the rewriting is have been combined. Use:

rewrite_header Subject [SPAM]

replacing “[SPAM] ” with whatever text you want to show up at the beginning of spammy messages’ subject lines.

spam_level_char X

If you use something like procmail, that supports regular expressions, matching against the asterisks that SpamAssassin uses by default is prone to errors. In SpamAssassin 2, you changed the asterisks in the X-Spam-Level header to something else using spam_level_char. In SpamAssassin 3, you use:

add_header all Level _STARS(X)_

replacing “X” with the character you wish to use in place of the asterisk in the X-Spam-Level header.


The various auto_learn rules have been changed to bayes_auto_learn. So, “auto_learn 0” is now “bayes_auto_learn 0”.


The use_terse_report rule has also changed in SpamAssassin 3. I couldn’t find the replacement, but thanks to Wolfgang from Vienna, I now know the answer:

remove_header all Report

This doesn’t switch from a detailed to a terse report header; it removes the detailed report completely. But (as I understand it) in SpamAssassin 3, the terse and detailed reports have been separated out into X-Spam-Status (the terse version) and X-Spam-Report (the detailed version). Removing the detailed version leaves just the terse version.

  1. <- MySQL Tutorial
  2. Scripting Graphics ->