aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Handlers
diff options
context:
space:
mode:
authorMark Sapiro <msapiro@value.net>2011-04-12 21:13:10 -0700
committerMark Sapiro <msapiro@value.net>2011-04-12 21:13:10 -0700
commite9ec77e3daca1779de124346a239c0e0fcfd74d7 (patch)
tree4cbcba527ed138ac3c1a410117980144052c5260 /Mailman/Handlers
parentdcbf47f5dad04b1b879dfe4fdc40d9aa633d403b (diff)
downloadmailman2-e9ec77e3daca1779de124346a239c0e0fcfd74d7.tar.gz
mailman2-e9ec77e3daca1779de124346a239c0e0fcfd74d7.tar.xz
mailman2-e9ec77e3daca1779de124346a239c0e0fcfd74d7.zip
Fixed a problem where content filtering could remove the headers from
an attached message/rfc822 part if the message in that part is multipart/alternative and collapse_alternatives is Yes. Bug #757062.
Diffstat (limited to 'Mailman/Handlers')
-rw-r--r--Mailman/Handlers/MimeDel.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Mailman/Handlers/MimeDel.py b/Mailman/Handlers/MimeDel.py
index 13845e4f..ab7483ba 100644
--- a/Mailman/Handlers/MimeDel.py
+++ b/Mailman/Handlers/MimeDel.py
@@ -187,7 +187,14 @@ def collapse_multipart_alternatives(msg):
if subpart.get_content_type() == 'multipart/alternative':
try:
firstalt = subpart.get_payload(0)
- newpayload.append(firstalt)
+ if msg.get_content_type() == 'message/rfc822':
+ # This is a multipart/alternative message in a
+ # message/rfc822 part. We treat it specially so as not to
+ # lose the headers.
+ reset_payload(subpart, firstalt)
+ newpayload.append(subpart)
+ else:
+ newpayload.append(firstalt)
except (IndexError, TypeError):
pass
elif subpart.is_multipart():