[Mailman-Users] Filtering Chinese spam.

Mark Sapiro mark at msapiro.net
Sun Apr 22 10:55:44 EDT 2018

On 04/21/2018 10:46 AM, Kenneth G. Gordon wrote:
> I have modified my settings in Privacy Options/Spam Filters thusly:
> ^Subject: =?utf-8?B?
> ^Subject:.*\?{4,}
> from: .*@qq.com
> from: .*ebdoor.com
> from: .*126.com
> from: .*139.com
> from: .*136.com
> from: .*163.com
> from: .*193.com

I'm a bit confused as to where you are putting these. The ones starting
with ^Subject: look like regexps that would be in header_filter_rules
and the ones starting with from: would also work in header_filter_rules
but look more like bounce_matching_headers entries.

It is best to use header_filter_rules for everything as it gives more
control over what to do with a matching message. In that case, it would
be better if the from ones were like

^from: .*@qq.com

to avoid a match on something like

Subject: message from: someone @qq.com

Also, if those from: lines are in bounce_matching_headers, it only
results in those messages being held and presumably the same end result
is obtained with Privacy options... -> Sender filters ->
generic_nonmember_action = Hold

> Instead, as someone mentioned in that thread of July 2016, I find that all Chinese posts 
> include the expression " =?utf-8?B?" following the word "Subject".
> Accordingly, I have included that in the first line of my Spam FIlter. However, it does not 
> seem to be working as desired as I am still receiving Chinese spam containing that 
> expression.

You need to understand regular expressions

'?' has a special meaning in a regexp. You need

^Subject: =\?utf-8\?B\?

to match something with a Subject beginning with =?utf-8?B?

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