[Mailman-Users] Newbie comments/questions
msapiro at value.net
Wed Oct 4 17:29:15 CEST 2006
Peter Davis wrote:
>Mark Sapiro wrote:
>> Since by default, membership tests are done before
>> bounce_matching_headers, you could use bounce_matching_headers to hold
>> the spam and the test will be done after membership.
>Possibly, but I want to hold these messages to determine whether or not
>they are truly spam. I don't want to simply bounce them automatically.
That's what bounce_matching_headers does. Historically, it may have
bounced, but currently it holds despite the attribute name. It says:
Hold posts with header value matching a specified regexp.
(Details for bounce_matching_headers)
and 'hold' is what it does.
>FAQ entry 3.32
>_Don't_ try to match the whole line by enclosing your pattern between
>beginning of line anchor ('^') and end of line anchor ('$').
>Should I ignore that?
I don't think that part of the FAQ entry is correct. Try it and report
back so we can update the FAQ if necessary.
The patterns in header_filter_rules are matched (using re.search)
against the entire message headers in MULTILINE mode. In MULTILINE
mode,using re.search, '^' matches the beginning of the string or
immediately following a newline and '$' matches the end of string or
immediately preceding a newline, so I think "^subject:\s*$" should
work. If not, try ^\r?subject:\s*$. In any case, the '^' was not the
critical change to your pattern; it is changing '\s' to '\s*' (which
will also allow '\r' at the end that is critical.
Note also, that bounce_matching_headers works differently than
header_filter_rules. bounce_matching_headers uses the first token to
define a header and then the remainder of the line is an re to search
in the values of all headers of that type.
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