aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2008-06-11 15:48:16 -0700
committerMark Sapiro <mark@msapiro.net>2008-06-11 15:48:16 -0700
commit584aa9c3d648067a0dd756cf561352b02d10ecc3 (patch)
tree5d726eb4f2fd42602d3990d8721bea3f3d2a19fb /Mailman
parent8297ba5977832dcfa7ee6035de02f46e7dc8cab9 (diff)
downloadmailman2-584aa9c3d648067a0dd756cf561352b02d10ecc3.tar.gz
mailman2-584aa9c3d648067a0dd756cf561352b02d10ecc3.tar.xz
mailman2-584aa9c3d648067a0dd756cf561352b02d10ecc3.zip
Fixed a problem in Decorate.py that could result in a multipart
message with no part headers for the original body part (1991348).
Diffstat (limited to 'Mailman')
-rw-r--r--Mailman/Handlers/Decorate.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Mailman/Handlers/Decorate.py b/Mailman/Handlers/Decorate.py
index 65037fbb..64d569db 100644
--- a/Mailman/Handlers/Decorate.py
+++ b/Mailman/Handlers/Decorate.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2007 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2008 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -159,9 +159,11 @@ def process(mlist, msg, msgdata):
# basis of the interior, wrapped Message.
inner = Message()
# Which headers to copy? Let's just do the Content-* headers
+ copied = False
for h, v in msg.items():
if h.lower().startswith('content-'):
inner[h] = v
+ copied = True
inner.set_payload(msg.get_payload())
# For completeness
inner.set_unixfrom(msg.get_unixfrom())
@@ -171,6 +173,10 @@ def process(mlist, msg, msgdata):
# get_content_charset isn't. However, do make sure there is a default
# content-type, even if the original message was not MIME.
inner.set_default_type(msg.get_default_type())
+ if not copied:
+ inner['Content-Type'] = inner.get_content_type()
+ if msg['mime-version'] == None:
+ msg['MIME-Version'] = '1.0'
# BAW: HACK ALERT.
if hasattr(msg, '__version__'):
inner.__version__ = msg.__version__