How to Make SpamAssassin Mark Spam in the Subject

Cans of SPAM
Learn how to make SpamAssassin mark detected spam in the Subject. Justin Sullivan / Getty Images

By default, SpamAssassin does not alter the Subject line of detected spam. This default setting is also the right one, I think (no need to remove "*****SPAM*****" when I reply).

If your email client does not allow filtering on arbitrary headers, tagging spam in the Subject: line is useful, however. Now you can tell the program to look for "*****SPAM*****" in the Subject: of incoming mail and send matching emails to the Trash immediately.

Make SpamAssassin Mark Spam in the Subject

To make SpamAssassin mark detected spam in Subject:

  • Open /etc/mail/spamassassin/local.cf in your favorite editor.
  • Add "rewrite_subject 1" to it.
    • If your SpamAssassin preferences file already has "rewrite_subject 0", change it to "rewrite_subject 1".

Since your personal SpamAssassin configuration file (~/.spamassassin/user_prefs) overrides all settings in local.cf, make sure "rewrite_subject" either is not in your personal configuration file or is set to "1", too.

And don't forget to remove "*****SPAM*****" from the Subject if you reply to a message erroneously tagged as spam by SpamAssassin.