accept_these_nonmembers from address encoding problem
Hi,
I have a problem in accept_these_nonmembers option. The system is not recognizing sender's address cause it contains an iso-8859-7 encoded name inside From: header.
As a result it does not much user's email which is included in accept_these_nonmembers.
The From: header is like this: From: =?iso-8859-7?B?1C7FLskuIMrRx9TH0ywg0NHPxcTRz9MgxS4gyuHw5fTh7dzq5/I=?=<user@example.com>
The system sees only a sender as ?.?.? instead of user@example.com
Can I force the use of envelope address instead of from address? I've tried setting SENDER_HEADERS = (None,) SENDER_HEADERS = ('from',) without any luck.
Any other option to try?
System is Centos 5 with mailman-2.1.9
Thanks in advance,
Giannis
On 12/11/2015 05:42 AM, Kapetanakis Giannis wrote:
The From: header is like this: From: =?iso-8859-7?B?1C7FLskuIMrRx9TH0ywg0NHPxcTRz9MgxS4gyuHw5fTh7dzq5/I=?=<user@example.com>
The system sees only a sender as ?.?.? instead of user@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 Mailman.
Can I force the use of envelope address instead of from address? I've tried setting SENDER_HEADERS = (None,) SENDER_HEADERS = ('from',) without any luck.
SENDER_HEADERS = (None,)
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
USE_ENVELOPE_SENDER = Yes
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 if USE_ENVELOPE_SENDER = No. If USE_ENVELOPE_SENDER = Yes, the 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 <http://bazaar.launchpad.net/~mailman-coders/mailman/2.1/revision/984> and <http://bazaar.launchpad.net/~mailman-coders/mailman/2.1/revision/1271> (rev 1271 is the fix, but it assumes rev 984).
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 11/12/15 19:02, Mark Sapiro wrote:
SENDER_HEADERS = (None,)
is correct, to use only the envelope sender.
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 <http://bazaar.launchpad.net/~mailman-coders/mailman/2.1/revision/984> and <http://bazaar.launchpad.net/~mailman-coders/mailman/2.1/revision/1271> (rev 1271 is the fix, but it assumes rev 984).
Thanks Mark for the very thorough reply.
Since the user's mail client does not use Sender header I'll try the patches.
best regards,
G
participants (2)
-
Kapetanakis Giannis
-
Mark Sapiro