aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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