Hi Folks,
(B
(BI've been reading -users with digest option. So, forgive me for
(Bcutting the thread. Since the patch manager of SF is not allowing
(Bto upload a new patch now, I send this to the list. (sorry, if
(Bit's folded)
(B
(BWith this patch, Decorate.py will try to make the footer and header
(Bin a plain text message by converting the three into unicode and
(Bthen encode in a appropriate (defined by mailman) charset.
(B
(BHope it helps!
(B
(B--
(BTokio Kikuchi
(B
(B---
(B/home/mailman/src/Release_2_1-maint/mailman/Mailman/Handlers/Decorate.py
(BWed Jan 8 11:13:38 2003
(B+++ Decorate.py Wed Jan 8 11:26:51 2003
(B@@ -78,17 +78,27 @@
(B # MIME multipart chroming the message?
(B wrap = 1
(B if not msg.is_multipart() and msgtype == 'text/plain' and \
(B- msg.get('content-transfer-encoding', '').lower() <>
(B'base64' and \
(B- (lcset == 'us-ascii' or mcset == lcset):
(B- oldpayload = msg.get_payload()
(B- frontsep = endsep = ''
(B- if header and not header.endswith('\n'):
(B- frontsep = '\n'
(B- if footer and not oldpayload.endswith('\n'):
(B- endsep = '\n'
(B- payload = header + frontsep + oldpayload + endsep + footer
(B- msg.set_payload(payload)
(B- wrap = 0
(B+ msg.get('content-transfer-encoding', '').lower() <> 'base64':
(B+ # TK: Try to keep the message plain by converting the header/
(B+ # footer/oldpayload into unicode and encode with mcset/lcset.
(B+ uheader = unicode(header, lcset)
(B+ ufooter = unicode(footer, lcset)
(B+ try:
(B+ oldpayload = unicode(msg.get_payload(), mcset)
(B+ frontsep = endsep = u''
(B+ if header and not header.endswith('\n'):
(B+ frontsep = u'\n'
(B+ if footer and not oldpayload.endswith('\n'):
(B+ endsep = u'\n'
(B+ payload = uheader + frontsep + oldpayload + endsep + ufooter
(B+ if lcset == 'us-ascii':
(B+ newcset = mcset
(B+ else:
(B+ newcset = lcset
(B+ msg.set_payload(payload.encode(newcset), newcset)
(B+ wrap = 0
(B+ except:
(B+ pass
(B elif msg.get_type() == 'multipart/mixed':
(B # The next easiest thing to do is just prepend the header and
(Bappend
(B # the footer as additional subparts
(B
(B
(B------------------------------------------------------
(BMailman-Users mailing list
([EMAIL PROTECTED]
(Bhttp://mail.python.org/mailman/listinfo/mailman-users
(BMailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
(BSearchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
(B
(BThis message was sent to: archive@jab.org
(BUnsubscribe or change your options at
(Bhttp://mail.python.org/mailman/options/mailman-users/archive%40jab.org