aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Handlers
diff options
context:
space:
mode:
authormsapiro <>2005-11-27 22:37:18 +0000
committermsapiro <>2005-11-27 22:37:18 +0000
commit40c37149fa132a872e1d62cf91b7efee7325a079 (patch)
tree9c893324670337362d00ec83d7f6ac86d434c61b /Mailman/Handlers
parent5132868860f4185cdc54b12b8306b94fda084572 (diff)
downloadmailman2-40c37149fa132a872e1d62cf91b7efee7325a079.tar.gz
mailman2-40c37149fa132a872e1d62cf91b7efee7325a079.tar.xz
mailman2-40c37149fa132a872e1d62cf91b7efee7325a079.zip
Fix bug 1367783 - decode base64 and quoted-printable HTML parts when passing to mm_cfg.HTML_TO_PLAIN_TEXT_COMMAND
Diffstat (limited to 'Mailman/Handlers')
-rw-r--r--Mailman/Handlers/MimeDel.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Mailman/Handlers/MimeDel.py b/Mailman/Handlers/MimeDel.py
index 33cfe142..2d5caa64 100644
--- a/Mailman/Handlers/MimeDel.py
+++ b/Mailman/Handlers/MimeDel.py
@@ -197,7 +197,7 @@ def to_plaintext(msg):
filename = tempfile.mktemp('.html')
fp = open(filename, 'w')
try:
- fp.write(subpart.get_payload())
+ fp.write(subpart.get_payload(decode=1))
fp.close()
cmd = os.popen(mm_cfg.HTML_TO_PLAIN_TEXT_COMMAND %
{'filename': filename})
@@ -213,6 +213,11 @@ def to_plaintext(msg):
# Now replace the payload of the subpart and twiddle the Content-Type:
subpart.set_payload(plaintext)
subpart.set_type('text/plain')
+ try:
+ # not base64 or quoted-printable any more
+ subpart.replace_header('content-transfer-encoding', '8bit')
+ except KeyError:
+ pass
changedp = 1
return changedp