[Mailman-Developers] Missing footers with latest CVS
Barry A. Warsaw
barry@zope.com
Tue, 12 Mar 2002 15:29:51 -0500
>>>>> "MZ" == Mikhail Zabaluev <mhz@alt-linux.org> writes:
MZ> This steps on my pet peeve with Mailman: Does this matching
MZ> regard Content-Transfer-Encoding as well? Tacking on text
MZ> strings to a base64 text/plain body is a recipe for disaster,
MZ> and such things happen, believe it or not.
It doesn't, but that's a good point, and I think, fairly easy to add
(see attached).
MZ> Continuing the Hippocratic theme, I'd suggest a rule: don't
MZ> meddle if it could hamper someone's reading capabilities. In
MZ> this case, don't make multipart/mixed embellishments unless it
MZ> IS multipart/mixed already.
This is the case, currently. It means that if the message doesn't
meet the plain/text criteria (+charset, +cte), and it's not already a
multipart/mixed, the header and footer are not added.
-Barry
-------------------- snip snip --------------------
Index: Decorate.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/Decorate.py,v
retrieving revision 2.13
diff -u -r2.13 Decorate.py
--- Decorate.py 12 Mar 2002 00:49:40 -0000 2.13
+++ Decorate.py 12 Mar 2002 20:29:12 -0000
@@ -72,6 +72,7 @@
# BAW: If the charsets don't match, should we add the header and footer by
# MIME multipart chroming the message?
if not msg.is_multipart() and msgtype == 'text/plain' and \
+ not msg.get('content-transfer-encoding').lower() == 'base64' and \
(lcset == 'us-ascii' or mcset == lcset):
payload = header + msg.get_payload() + footer
msg.set_payload(payload)