[Mailman-Users] Envelope address vs. From: header addresses
Mark Sapiro
mark at msapiro.net
Tue Jan 3 18:22:07 EST 2017
On 01/03/2017 01:27 PM, Adam Goldberg wrote:
>
> Thanks for the quick response. From what I can see in Defaults.py in my installation of Mailman, one could 'break' Mailman the same way Kavi's ezmlm installation is broken by merely setting USE_ENVELOPE_SENDER=yes.
Actually no, for two reasons.
USE_ENVELOPE_SENDER is a misnomer in the first place. It is used by the
Mailman.Message.get_sender() method which returns a single address as
the sender of the message. It returns the first address found by looking
in order at
From:
Sender:
envelope sender
if USE_ENVELOPE_SENDER is false and
Sender:
From:
envelope sender
if USE_ENVELOPE_SENDER is true, so in most cases there won't be a
Sender: header and the From: value will be returned. Only if there is a
Sender: header does USE_ENVELOPE_SENDER make a difference and even then
the result is the Sender: header value, not the envelope sender.
The other reason is the get_sender() method is not used to determine
list membership for posts[1]. That uses the get_senders() method (note
senders, not sender) which returns all the addresses from the headers
defined by SENDER_HEADERS.
If you wanted to force Mailman to use the envelope sender only for
membership tests you would put
SENDER_HEADERS = [None]
in mm_cfg.py.
[1] The address returned by get_sender() is used for things like
displaying in the admindb UI the sender of a held post and various other
purposes, but not for membership tests on incoming posts.
> (And continuing the OT discussion, in a ezmlm/qmail environment, qmail passes the envelope sender address via $SENDER to ezmlm, and ezmlm uses this to check list membership. I don't see a way in qmail/ezmlm to emulate USE_ENVELOPE_SENDER = No. Three cheers for Mailman!)
MTAs (qmail) for the most part only deal with things defined in SMTP
such as the envelope sender and recipients. With few exceptions, the
message which contains the headers is just a blob of data. Thus if
you're relying on the MTA to tell you who sent the message, you're going
to see the envelope sender. Mailman actually parses the message and
looks at the headers to determine the sender(s).
--
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