[Mailman-Users] Subject line message filtering

Chris Nulk cnulk at scu.edu
Mon Feb 11 18:01:54 CET 2013

On 2/8/2013 4:28 PM, Mark Sapiro wrote:
> Chris Nulk wrote:
>> My regex filter is:
>>        ^Subject:[\s\+]*\[.*\]\s+(Invitation|Canceled Event):.*
> I know you've resolved this and that the issue was that
> header_filter_rules are processed way before the subject_prefix is added
> so you didn't want the '\[.*\]'part of the pattern, but I'm confused by
> the '[\s\+]*' part of the pattern which says match 0 or more occurrences
> of the character class consisting of any white space character (\s) and
> the plus sign (either \+ or just + would be equivalent here, + loses its
> special meaning inside []).
> So, is [\s\+]* a typo or did you just mean \s+ or \s*?

The [\s\+]* was deliberate.  Most of our lists but the list name in 
brackets ('[', ']'), however, we have a few lists that are members of 
another list.  For those lists the list subject prefix is a plus-sign 
('+').   For example, we have a student list that has the [Student] 
prefix when the messages go out.  Faculty and staff are not members of 
the list and don't receive those messages.  Yet, there are a few faculty 
and staff who have an interest in seeing the messages so those 
faculty/staff are put on a "listening" list which is a member of the 
student list.  When a message goes to the student list, the prefix 
[Student] is added to the subject line.  The message is then sent to the 
"listening" list and it adds its own subject prefix.  Instead of having 
'[Student-Listen][Student]' show in the subject line, I changed it to a 
'+'.  The long and short of it is that I was trying to match both types 
of lines and the [\s\+]* was the bit for matching the "listening" list's 
subject prefix.

>> Also, can any of the sender/recipient filters cause the message to bypass the spam filters?  The message pipeline is unchanged.
> No. header_filter_rules are processed by SpamDetect which is the first
> module in the pipeline. As you discovered, the CookHeaders module which
> adds the subject_prefix comes much later, and the sender/recipient
> filters are processed by Moderate which also comes later.
Great information to know, thanks.

The only issue I have now is the boss wants to be able to send a reject 
message if a message is rejected when it matches a rule.  The only 
option I have is to hold the message and let the moderator send the 
rejection notice.  And since, the header rule is for our global lists, I 
am the lucky moderator.

Thanks for all the great help,

More information about the Mailman-Users mailing list