2.7.4 Spam Filters

This section provides some adjuncts to spam fighting tools; it doesn't replace dedicated anti-spam tools such as SpamAssassin or SpamBayes.

This variable contains header regular expressions, one per line, and if any of a message's headers matches one of these patterns, it will be held for moderation. The format is a colon separated header and value, where the header is case insensitive and the value is any valid Python regular expression. Lines that start with # are ignored.

This variable can be used to catch known spammers by writing regexps that match against To: or Cc: lines, or known-bad Message-ID:s. Perhaps more useful though are patterns that match headers added by spam detection tools higher up in the tool chain. For example, you might configure SpamAssassin to add an X-Spam-Score: header with between zero and 5 stars depending on the spam score. Then you can add a line to this variable like:

    X-Spam-Score: [*]{3,5}

This line will match from 3 to 5 stars in the value of this field.