From 01468e7eae8d44d740edcf2dbaa2d1575c02c7a7 Mon Sep 17 00:00:00 2001 From: tkikuchi <> Date: Wed, 13 Jul 2005 07:04:09 +0000 Subject: Introduce new attribute (collapse_alternatives) to allow HTML in multipart/alternative message after content filtering. --- Mailman/Handlers/MimeDel.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Mailman/Handlers') diff --git a/Mailman/Handlers/MimeDel.py b/Mailman/Handlers/MimeDel.py index 79efa620..3afdce95 100644 --- a/Mailman/Handlers/MimeDel.py +++ b/Mailman/Handlers/MimeDel.py @@ -90,10 +90,12 @@ def process(mlist, msg, msgdata): # headers. For now we'll move the subpart's payload into the outer part, # and then copy over its Content-Type: and Content-Transfer-Encoding: # headers (any others?). - collapse_multipart_alternatives(msg) - if ctype == 'multipart/alternative': - firstalt = msg.get_payload(0) - reset_payload(msg, firstalt) + # TK: Make this configurable from Gui/ContentFilter.py. + if mlist.collapse_alternatives: + collapse_multipart_alternatives(msg) + if ctype == 'multipart/alternative': + firstalt = msg.get_payload(0) + reset_payload(msg, firstalt) # If we removed some parts, make note of this changedp = 0 if numparts <> len([subpart for subpart in msg.walk()]): -- cgit v1.2.3