[Mailman-Users] UTF-8 From and Reply-to addresses not getting properly processed.

Mark Sapiro mark at msapiro.net
Sun Feb 16 15:08:53 EST 2020


Munged a few words.

On 2/15/20 11:20 PM, Lindsay Haisley wrote:

> The only filter relevant to this issue is "(?i)Subject: .*[f...]".

The (?i) is irrelevant as the match always ignores case. Also, I don't
think that's what you want as it will match any Subject that contains
any of the letters f, u, c, k in either case. What is the action of this
rule?


On 2/16/20 10:17 AM, Lindsay Haisley wrote:
> 
> We want to discard _all_ non-member
> posts, and the problem is that these base64-addressed posts _are_ being
> held and not discarded. 


If generic_nonmember_action is Discard, non-member posts should be
discarded unless some prior test causes them to be held. Things which
could cause a hold are in order:

A match on a header_filter_rule with a Hold action.

One of the addresses returned by get_senders() is a moderated member and
member_moderation_action is Hold.

None of the addresses returned by get_senders() is a member and the
address returned by get_sender() matches an entry in hold_these_nonmembers

An address returned by get_senders() is an unmoderated member and the
list's emergency setting is Yes.

What is the reason given for the hold?

In the case of the message headers in your OP, get_senders() will return
a list like

['=?utf-8?b?ikfiaweiidxbymlhqg11bhrplm5ldc5waz4=?=',
'abia at multi.net.pk',
'=?utf-8?b?ikfiaweiidxbymlhqg11bhrplm5ldc5waz4=?=']

which are lowercased versions of respectively, the undecoded From:, The
unix from which I deduce from Return-Path: and the undecoded Reply-To:.
Both the original From: and Reply-To: decode to

"Abia" <Abia at multi.net.pk>

msg.get_sender() returns '=?utf-8?b?ikfiaweiidxbymlhqg11bhrplm5ldc5waz4=?='

>From what you've said, that message whose decoded Subject: header is

Subject: I InstaF... Request is Pending

would match the header_filter_rule and be handled per that rule's
action, but then so would a message with

Subject: It's a fine day

You can decode these headers like

python
...
>>> from email.header import decode_header
>>> decode_header('=?utf-8?B?IkFiaWEiIDxBYmlhQG11bHRpLm5ldC5waz4=?=')
[('"Abia" <Abia at multi.net.pk>', 'utf-8')]


-- 
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