[Mailman-Users] I need to get "Sender:" address
Rob Jackson
robertj at linux4free.com
Fri Sep 29 22:09:43 CEST 2006
Great, thanks, that worked. I read about the USE_ENVELOPE_SENDER, but it
did not seem that it applied, a little confused there.
Thanks
-Rob
-----Original Message-----
From: Mark Sapiro [mailto:msapiro at value.net]
Sent: Friday, September 29, 2006 12:42 PM
To: Rob Jackson; mailman-users at python.org
Subject: Re: [Mailman-Users] I need to get "Sender:" address
Rob Jackson wrote:
>I have messages coming from a Gatewayed Message board to mailman.
>There is an extra field To: field and a Sender: field and I need to get
>the Sender e-mail address.
>
>I have tried modifying the SENDER_HEADERS to
>('sender','from',None,'reply-to'), so sender is before from, but it
>still grabs the "From" even if "Sender exists."
Which headers are searched and in which order depends on several things
including context. You probably need to set USE_ENVELOPE_SENDER to Yes in
mm_cfg.py.
Here are the details:
There are two Mailman.Message.Message methods for getting the sender.
They are get_sender() and get_senders().
If USE_ENVELOPE_SENDER is Yes or True, get_sender() returns the first
address found from the headers Sender:, From:, and the unixfrom or envelope
sender. Otherwise the search order is From:, Sender:, unixfrom.
OTOH, get_senders() returns a list of all the addresses found in all the
headers listed in SENDER_HEADERS.
Thus, changing SENDER_HEADERS has no effect on the address returned by
get_sender() and reordering SENDER_HEADERS only affects the order of the
addresses returned by get_senders().
The distinction is important, because in some contexts (e.g.
determining whether the sender is a list member), get_senders() is used to
get a list of addresses, whereas in other contexts (e.g.
determining if the sender is in *_these_nonmembers), get_sender() is used to
get a single address.
--
Mark Sapiro <msapiro at value.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