Filtering messages with no subject
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?
Thanks for any help,
--Bryan
-- Bryan Blackwell -- Unix Systems Engineer bryan@skiblack.com
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@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On May 29, 2018, at 4:33 PM, Mark Sapiro <mark@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
On 05/29/2018 01:49 PM, Bryan Blackwell wrote:
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?
Yes, it's OK to leave them. If all you have there are the default ones, they're ancient and probably never match anything, but they don't hurt.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Bryan Blackwell -
Mark Sapiro