[Mailman-Users] Filtering on subject prefix

Mark Sapiro msapiro at value.net
Mon Dec 11 18:59:01 CET 2006


Gordon Moyer wrote:

>I am running mailman 2.1.9 and I'd like to auto discard list emails
>with a subject prefix of "***SPAM***" (this is being done by
>spamasassin).  I've been looking for rule documentation, and haven't
>been able to find any.
>
>Can anyone tell me what the rule would look like that would filter on
>this subject prefix?  ...Or maybe someone can point me toward any rule
>documentation that exists.


header_filter_rules have a regular expression (regexp) and an action.
The regexp is a Python regexp which is searched case insensitively
against the message headers including part headers of multipart
messages. See <http://docs.python.org/lib/re-syntax.html> for
documentation of Python regexp syntax.

In your case, you may want something like

  ^subject:\s*\*\*\*spam\*\*\*

to match a header that begins with 'subject:' followed by zero or more
whitespace characters (\s*) vollowed by three literal asterisks
followed by 'spam' followed by three more literal asterisks (although,
you probably want five asterisks, not three).

However, to get spamassassin flagged messages, I would use instead

  ^x-spam-flag:\s*yes$

-- 
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list