diff options
author | Mark Sapiro <mark@msapiro.net> | 2014-05-17 10:45:30 -0700 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2014-05-17 10:45:30 -0700 |
commit | 162234d13d13817514fc47c7422191dfd8b73ec9 (patch) | |
tree | 92e0b51d0e96a3f8145e33c98165772eddae85a9 /Mailman | |
parent | 8b03576a41b082df803bb0696af9eb440ff219f4 (diff) | |
download | mailman2-162234d13d13817514fc47c7422191dfd8b73ec9.tar.gz mailman2-162234d13d13817514fc47c7422191dfd8b73ec9.tar.xz mailman2-162234d13d13817514fc47c7422191dfd8b73ec9.zip |
Changed the fix for LP: #1316682 to not create a message that triggers
Python issue 7970 rather than incorporating the fix for issue 7970 in our
Generator subclass.
Diffstat (limited to 'Mailman')
-rw-r--r-- | Mailman/Handlers/WrapMessage.py | 4 | ||||
-rw-r--r-- | Mailman/Message.py | 19 |
2 files changed, 2 insertions, 21 deletions
diff --git a/Mailman/Handlers/WrapMessage.py b/Mailman/Handlers/WrapMessage.py index 9678f6fd..d6483e7f 100644 --- a/Mailman/Handlers/WrapMessage.py +++ b/Mailman/Handlers/WrapMessage.py @@ -67,6 +67,6 @@ def process(mlist, msg, msgdata): # Add the headers from CookHeaders. for k, v in msgdata['add_header'].items(): msg[k] = v - # And set the payload. - msg.set_payload(omsg.as_string()) + # And set the payload the way email parses it. + msg.set_payload([omsg]) diff --git a/Mailman/Message.py b/Mailman/Message.py index 20610dc7..5d68e7ef 100644 --- a/Mailman/Message.py +++ b/Mailman/Message.py @@ -59,25 +59,6 @@ class Generator(email.Generator.Generator): return self.__class__(fp, self._mangle_from_, self.__children_maxheaderlen, self.__children_maxheaderlen) - # This is the _handle_message method with the fix for bug 7970. - def _handle_message(self, msg): - s = StringIO() - g = self.clone(s) - # The payload of a message/rfc822 part should be a multipart sequence - # of length 1. The zeroth element of the list should be the Message - # object for the subpart. Extract that object, stringify it, and - # write it out. - # Except, it turns out, when it's a string instead, which happens when - # and only when HeaderParser is used on a message of mime type - # message/rfc822. Such messages are generated by, for example, - # Groupwise when forwarding unadorned messages. (Issue 7970.) So - # in that case we just emit the string body. - payload = msg.get_payload() - if isinstance(payload, list): - g.flatten(msg.get_payload(0), unixfrom=False) - payload = s.getvalue() - self._fp.write(payload) - class Message(email.Message.Message): |