[Mailman-Users] Trapping messages with null subjects sent to list

Mark Sapiro msapiro at value.net
Wed Mar 14 05:03:49 CET 2007

vancleef at lostwells.net wrote:

>The esteemed Mark Sapiro has said:
>> vancleef at lostwells.net wrote:
>> >Is there a recipe to put in the spam filters that will trap a totally
>> >empty subject line in a message?   This get posted to a list with 
>> >(no subject) in the subject line, but this is evidently added after
>> >the spam filter check.  
>> Try the following regexp in header_filter_rules with a Hold action
>> ^subject:\s*(\(no subject\))?\s*$
>I put that line in the spam filter (actually, copied and pasted it).
>I'm still seeing the first post with a null subject line blasting
>through without getting trapped.  It shows up as (no subject) when
>distributed by the list, but isn't trapped until it's gone out to the
>list (too late).
>All the responses, of course, get trapped by the preexisting trap.
>I did try
>But that traps a bunch of mangled subject lines where the user's MUA
>has munged the original to add spaces.

The original regexp in header_filter_rules should catch any subject
header consisting only of white space and zero or one occurrences of
'(no subject)'.

I think the issue may be that the incoming post has no Subject: header
at all rather than an empty one. In this event, if there is a
subject_prefix, Mailman will add a Subject: header with the list
prefix and '(no subject)'. If there is no subject_prefix, the message
will be sent from Mailman with no Subject: header.

If that is the issue, you need 3 header_filter_rules. The first is as
above to catch the empty or (no subject). The second is with a regexp


and an action of accept to accept the remaining messages with Subject:
headers, and the third has a regexp


and an action of hold to hold all messages that fall through the second.

If you have other header_filter_rules, they should come before the
accept rule (#2) or they won't be reached.

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