[Mailman-Users] Filtering messages with no subject

Mark Sapiro mark at msapiro.net
Tue May 29 16:33:38 EDT 2018


On 5/29/18 1:01 PM, Bryan Blackwell wrote:
> Hi folks,
> 
> I'm having trouble with some spam using spoofed addresses getting through to my lists, they all seem to have no subject.  I don't see any obvious way to filter these, am I missing an option?  If not, has anyone implemented a filter to block these sorts of messages?


Use header_filter_rules (on the admin Privacy options... -> Spam filters
page.

A regexp of

^subject:\s*(\(no subject\))?\s*$

will match messages with an empty Subject: header or literally '(no
subject)', but it's more complicated than that because the message may
have no Subject: header at all. To account for that you need three
rules. The first of these has the regexp above with an action of
discard. The second has the regexp

^subject:

and an action of accept to accept messages with Subject: headers that
didn't match the first rule, and the third has the regexp

^.*$

and action discard to discard all messages that got past the first two,
i.e. those with no Subject: header at all.

If you already have header_filter_rules, these three are added after the
others. Otherwise, they are the only rules.

-- 
Mark Sapiro <mark at msapiro.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