From 75dee062afed5d1432820d897de3bcf3dc2e8238 Mon Sep 17 00:00:00 2001 From: tkikuchi <> Date: Sat, 17 Dec 2005 05:11:44 +0000 Subject: 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. --- Mailman/Archiver/HyperArch.py | 7 ++++++- Mailman/Archiver/pipermail.py | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'Mailman/Archiver') 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() -- cgit v1.2.3