------------------------------------------------------------ revno: 1476 committer: Mark Sapiro <m...@msapiro.net> branch nick: 2.1 timestamp: Fri 2014-05-02 10:21:48 -0700 message: Updated CookHeaders to always add the poster's From: address to Reply-To: when applying from_is_list transformations. modified: Mailman/Handlers/CookHeaders.py tests/test_handlers.py
-- lp:mailman/2.1 https://code.launchpad.net/~mailman-coders/mailman/2.1 Your team Mailman Checkins is subscribed to branch lp:mailman/2.1. To unsubscribe from this branch go to https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'Mailman/Handlers/CookHeaders.py' --- Mailman/Handlers/CookHeaders.py 2014-04-26 04:03:52 +0000 +++ Mailman/Handlers/CookHeaders.py 2014-05-02 17:21:48 +0000 @@ -166,17 +166,11 @@ # 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 === modified file 'tests/test_handlers.py' --- tests/test_handlers.py 2014-04-24 22:43:30 +0000 +++ tests/test_handlers.py 2014-05-02 17:21:48 +0000 @@ -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 @@ """, Message.Message) msgdata = {} CookHeaders.process(mlist, msg, msgdata) - eq(msgdata['add_header']['Reply-To'], '_xt...@dom.ain') + eq(msgdata['add_header']['Reply-To'], + 'aper...@dom.ain, _xt...@dom.ain') eq(msg.get_all('reply-to'), ['bper...@dom.ain']) def test_reply_to_explicit(self): @@ -713,7 +714,8 @@ msgdata = {} CookHeaders.process(self._mlist, msg, msgdata) - eq(msgdata['add_header']['Reply-To'], 'ml...@dom.ain') + eq(msgdata['add_header']['Reply-To'], + 'ml...@dom.ain, aper...@dom.ain') eq(msg.get_all('reply-to'), ['bper...@dom.ain']) def test_reply_to_extends_to_list(self): @@ -748,7 +750,7 @@ CookHeaders.process(mlist, msg, msgdata) eq(msgdata['add_header']['Reply-To'], - 'aper...@dom.ain, bper...@dom.ain, _xt...@dom.ain') + 'bper...@dom.ain, aper...@dom.ain, _xt...@dom.ain') def test_reply_to_extends_to_explicit(self): eq = self.assertEqual @@ -782,7 +784,7 @@ msgdata = {} CookHeaders.process(mlist, msg, msgdata) eq(msgdata['add_header']['Reply-To'], - 'ml...@dom.ain, aper...@dom.ain, bper...@dom.ain') + 'ml...@dom.ain, bper...@dom.ain, aper...@dom.ain') def test_list_headers_nolist(self): eq = self.assertEqual
_______________________________________________ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org