[Mailman-Users] accept_these_nonmembers from address encoding problem

Mark Sapiro mark at msapiro.net
Fri Dec 11 12:02:00 EST 2015

On 12/11/2015 05:42 AM, Kapetanakis Giannis wrote:
> The From: header is like this:
> From:
> =?iso-8859-7?B?1C7FLskuIMrRx9TH0ywg0NHPxcTRz9MgxS4gyuHw5fTh7dzq5/I=?=<user at example.com>
> The system sees only a sender as ?.?.? instead of user at example.com

I think this is <https://bugs.launchpad.net/mailman/+bug/702516> fixed
in MM 2.1.15. In any case, this From: is properly recognized in current

> Can I force the use of envelope address instead of from address?
> I've tried setting
> SENDER_HEADERS = ('from',)
> without any luck.


is correct, to use only the envelope sender.

SENDER_HEADERS = ('from',)

will use only the From: header which is exactly what you don't want.

But, these won't help. What you want is


but that may not help either. The issue is complicated. A Mailman
Message instance has two methods, get_sender() and get_senders().

get_sender() returns a single address which is the first address found
in the From: header, the Sender: header or the envelope sender in that
order is Sender: header, From: header, envelope sender, so
USE_ENVELOPE_SENDER is really a misnomer; it really means prefer Sender:
over From:.

get_senders() returns a list of all the addresses found in the places
listed in SENDER_HEADERS searched in the order they appear there, so
with SENDER_HEADERS = (None,), get_senders() will return a list
containing only the envelope sender.

The issue you have is because Mailman uses the addrersses returned by
get_senders() to determine list membership. If one of those addresses is
a list member, the post is determined to be a post from the first member
address in get_senders(), but if none of those is a list member, only
the address returned by get_sender() is checked against *_these_nonmembers.

The bottom line here is the only way to address this with list settings
is to set USE_ENVELOPE_SENDER = Yes and to ensure that the incoming post
has a Sender: header with the sender's address.

If you can't do that and you can't upgrade to at least Mailman 2.1.15,
you could consider patching Mailman/Message.py to make get_sender()
return the 'unixfrom', or you could install both patches at
(rev 1271 is the fix, but it assumes rev 984).

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