diff options
author | tkikuchi <> | 2005-12-17 05:11:44 +0000 |
---|---|---|
committer | tkikuchi <> | 2005-12-17 05:11:44 +0000 |
commit | 75dee062afed5d1432820d897de3bcf3dc2e8238 (patch) | |
tree | c0cb18cab8ab2e89526fbefc04a5737d94a4bcf4 /Mailman/Archiver | |
parent | 4fc195111db5d68eb97d259ed8bc67beae95302d (diff) | |
download | mailman2-75dee062afed5d1432820d897de3bcf3dc2e8238.tar.gz mailman2-75dee062afed5d1432820d897de3bcf3dc2e8238.tar.xz mailman2-75dee062afed5d1432820d897de3bcf3dc2e8238.zip |
Fixes for email.set_payload() not distinguish parsed or virgin payload.
I've tested the example by Mark Sapiro:
http://mail.python.org/pipermail/mailman-developers/2005-November/018395.html
both with and without 'Content-Transfer-Encoding' but may need more test.
Diffstat (limited to 'Mailman/Archiver')
-rw-r--r-- | Mailman/Archiver/HyperArch.py | 7 | ||||
-rw-r--r-- | Mailman/Archiver/pipermail.py | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/Mailman/Archiver/HyperArch.py b/Mailman/Archiver/HyperArch.py index 6f66db4a..3fc5fadf 100644 --- a/Mailman/Archiver/HyperArch.py +++ b/Mailman/Archiver/HyperArch.py @@ -303,7 +303,12 @@ class Article(pipermail.Article): if charset[0]=="'" and charset[-1]=="'": charset = charset[1:-1] try: - body = message.get_payload(decode=True) + # Check Scrubber-munged payload + if message.get('x-mailman-scrubbed'): + decode = False + else: + decode = True + body = message.get_payload(decode=decode) except binascii.Error: body = None if body and charset != Utils.GetCharSet(self._lang): diff --git a/Mailman/Archiver/pipermail.py b/Mailman/Archiver/pipermail.py index fac7e5ed..f27e1101 100644 --- a/Mailman/Archiver/pipermail.py +++ b/Mailman/Archiver/pipermail.py @@ -217,7 +217,12 @@ class Article: self.headers[i] = message[i] # Read the message body - s = StringIO(message.get_payload(decode=1)\ + # Check Scrubber-munged paylaod + if message.get('x-mailman-scrubbed'): + decode = False + else: + decode = True + s = StringIO(message.get_payload(decode=decode)\ or message.as_string().split('\n\n',1)[1]) self.body = s.readlines() |