[Mailman-Users] Content-Transfer-Encoding: not workng as expected.

Mark Sapiro mark at msapiro.net
Fri Nov 15 04:06:46 CET 2013

On 11/13/2013 11:52 PM, Roel Wagenaar wrote:
> My /etc/procmailrc is decoding Content-Transfer-Encoding: base64 headers as
> standard rule forall incoming mail.
> Funny thing happens when filtered mailis beiing resend by Maiman, it encode
> the base64 part again, is there an option to prevent this? I don't seem to
> beable to find it.

I am guessing that you are talking about plain text message bodies with
character set UTF-8, and your list is adding a msg_header or msg_footer,
although there could be other cases as well.

This issue is due to the Python email package. In order to add a
msg_header or msg_footer to the message body, mailman has to do
set_payload() on the email.message.Message instance. This in turn does
set_charset() which encodes the body with the encoding of the
body_encoding attribute of the email.charset.Charset instance for that
character set. For UTF-8, this is base64.

If my guess is correct, you may be able to avoid the re-encoding by
making sure the list's msg_header and msg_footer are empty.

Otherwise, you could look at Mailman/Handlers/Decorate.py and try adding
the following near the beginning after "import re"

import email.charset
email.charset.CHARSETS['utf-8'] = (SHORTEST,  None, 'utf-8')

Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the Mailman-Users mailing list