diff options
author | Mark Sapiro <mark@msapiro.net> | 2014-05-02 10:21:48 -0700 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2014-05-02 10:21:48 -0700 |
commit | 2fea4236517bf402e8ba5517cbb2153e435f3995 (patch) | |
tree | d8f4fd1126e3a8dbb23bf80a34b1b842cc3c0eac | |
parent | 4a9471f8c916f06b7fb235aed635bae016a4b39a (diff) | |
download | mailman2-2fea4236517bf402e8ba5517cbb2153e435f3995.tar.gz mailman2-2fea4236517bf402e8ba5517cbb2153e435f3995.tar.xz mailman2-2fea4236517bf402e8ba5517cbb2153e435f3995.zip |
Updated CookHeaders to always add the poster's From: address to Reply-To:
when applying from_is_list transformations.
-rwxr-xr-x | Mailman/Handlers/CookHeaders.py | 10 | ||||
-rw-r--r-- | tests/test_handlers.py | 12 |
2 files changed, 9 insertions, 13 deletions
diff --git a/Mailman/Handlers/CookHeaders.py b/Mailman/Handlers/CookHeaders.py index 4fbfa311..02d09c0d 100755 --- a/Mailman/Handlers/CookHeaders.py +++ b/Mailman/Handlers/CookHeaders.py @@ -166,17 +166,11 @@ def process(mlist, msg, msgdata): # cases we'll zap the existing field because RFC 2822 says max one is # allowed. if not mlist.first_strip_reply_to: - # If we Munged the From:, add it to Reply-To: if we're not - # stripping it. - #MAS ? Should we add it anyway? - if o_from: - add(o_from) orig = msg.get_all('reply-to', []) for pair in getaddresses(orig): add(pair) - # We also need to put the old From: in Reply-To: if reply_goes_to_list - # is to the poster even if we're stripping Reply-To: - if mlist.reply_goes_to_list == 0 and o_from: + # We also need to put the old From: in Reply-To: in all cases. + if o_from: add(o_from) # Set Reply-To: header to point back to this list. Add this last # because some folks think that some MUAs make it easier to delete diff --git a/tests/test_handlers.py b/tests/test_handlers.py index 794288e8..c3df0cb8 100644 --- a/tests/test_handlers.py +++ b/tests/test_handlers.py @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2011 by the Free Software Foundation, Inc. +# Copyright (C) 2001-2014 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -646,7 +646,8 @@ Reply-To: bperson@dom.ain """, Message.Message) msgdata = {} CookHeaders.process(mlist, msg, msgdata) - eq(msgdata['add_header']['Reply-To'], '_xtest@dom.ain') + eq(msgdata['add_header']['Reply-To'], + 'aperson@dom.ain, _xtest@dom.ain') eq(msg.get_all('reply-to'), ['bperson@dom.ain']) def test_reply_to_explicit(self): @@ -713,7 +714,8 @@ Reply-To: bperson@dom.ain msgdata = {} CookHeaders.process(self._mlist, msg, msgdata) - eq(msgdata['add_header']['Reply-To'], 'mlist@dom.ain') + eq(msgdata['add_header']['Reply-To'], + 'mlist@dom.ain, aperson@dom.ain') eq(msg.get_all('reply-to'), ['bperson@dom.ain']) def test_reply_to_extends_to_list(self): @@ -748,7 +750,7 @@ Reply-To: bperson@dom.ain CookHeaders.process(mlist, msg, msgdata) eq(msgdata['add_header']['Reply-To'], - 'aperson@dom.ain, bperson@dom.ain, _xtest@dom.ain') + 'bperson@dom.ain, aperson@dom.ain, _xtest@dom.ain') def test_reply_to_extends_to_explicit(self): eq = self.assertEqual @@ -782,7 +784,7 @@ Reply-To: bperson@dom.ain msgdata = {} CookHeaders.process(mlist, msg, msgdata) eq(msgdata['add_header']['Reply-To'], - 'mlist@dom.ain, aperson@dom.ain, bperson@dom.ain') + 'mlist@dom.ain, bperson@dom.ain, aperson@dom.ain') def test_list_headers_nolist(self): eq = self.assertEqual |