aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Handlers
diff options
context:
space:
mode:
authortkikuchi <>2004-10-14 08:05:06 +0000
committertkikuchi <>2004-10-14 08:05:06 +0000
commit9bdb4029f331ea6230c668e408c2f694491ec6e4 (patch)
tree9c535e2969721c58494fe720bf98491c281e8934 /Mailman/Handlers
parentd65a27a0dc0456e3939e2068e1866589e8a00f41 (diff)
downloadmailman2-9bdb4029f331ea6230c668e408c2f694491ec6e4.tar.gz
mailman2-9bdb4029f331ea6230c668e408c2f694491ec6e4.tar.xz
mailman2-9bdb4029f331ea6230c668e408c2f694491ec6e4.zip
fix bugs when using ARCHIVE_HTML_SANITIZER = 1
Diffstat (limited to 'Mailman/Handlers')
-rw-r--r--Mailman/Handlers/Scrubber.py5
-rw-r--r--Mailman/Handlers/ToDigest.py3
2 files changed, 5 insertions, 3 deletions
diff --git a/Mailman/Handlers/Scrubber.py b/Mailman/Handlers/Scrubber.py
index 7429c0b4..6116806b 100644
--- a/Mailman/Handlers/Scrubber.py
+++ b/Mailman/Handlers/Scrubber.py
@@ -309,7 +309,7 @@ Url : %(url)s
# We still have to sanitize multipart messages to flat text because
# Pipermail can't handle messages with list payloads. This is a kludge;
# def (n) clever hack ;).
- if msg.is_multipart():
+ if msg.is_multipart() and sanitize <> 2:
# By default we take the charset of the first text/plain part in the
# message, but if there was none, we'll use the list's preferred
# language's charset.
@@ -402,7 +402,8 @@ def save_attachment(mlist, msg, dir, filter_html=True):
# For safety, we should confirm this is valid ext for content-type
# but we can use fnext if we introduce fnext filtering
if mm_cfg.SCRUBBER_USE_ATTACHMENT_FILENAME_EXTENSION:
- ext = fnext
+ # HTML message doesn't have filename :-(
+ ext = fnext or guess_extension(ctype, fnext)
else:
ext = guess_extension(ctype, fnext)
if not ext:
diff --git a/Mailman/Handlers/ToDigest.py b/Mailman/Handlers/ToDigest.py
index f350768e..2f64b369 100644
--- a/Mailman/Handlers/ToDigest.py
+++ b/Mailman/Handlers/ToDigest.py
@@ -314,7 +314,8 @@ def send_i18n_digests(mlist, mboxfp):
uh = '\n\t'.join(uh.split('\n'))
print >> plainmsg, uh
print >> plainmsg
- payload = msg.get_payload(decode=True)
+ payload = msg.get_payload(decode=True)\
+ or msg.as_string().split('\n\n',1)[1]
print >> plainmsg, payload
if not payload.endswith('\n'):
print >> plainmsg