[Mailman-Users] Filtering messages with no subject

Bryan Blackwell bryan at skiblack.com
Tue May 29 16:49:29 EDT 2018


On May 29, 2018, at 4:33 PM, Mark Sapiro <mark at msapiro.net> wrote:
> 
> 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.
> 
Excellent, thanks.  I put them in with 'hold' instead of 'discard' for now just in case I made a mistake.  Right now I have a bunch of lines in the Legacy section, is it ok to leave those in place?

--Bryan


More information about the Mailman-Users mailing list