Content-Transfer-Encoding: not workng as expected.

L.S.
Mailman version 2.1.15-1 Debian Wheezy
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.
As a test case I havemade a copy recipy tgat make procmail send a copy of all mail to Mailman to the same server where the list-messages go to, these copies are not encoded.
Funny.
-- Roel Wagenaar,
Linux-User #469851 with the Linux Counter; http://linuxcounter.net/
Antw.: Omdat het de volgorde verstoord waarin mensen tekst lezen. Vraag: Waarom is top-posting een slechte gewoonte? Antw.: Top-posting. Vraag: Wat is het meest ergerlijke in e-mail?
Climate is what you expect. Weather is what you get.

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@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark Sapiro <mark@msapiro.net> wrote:
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')
Yes, I have msg_footer active, and don't want it empty.
I have adde your lines right after "import re", and almost instantly get the "We hit a bug" message in the web interface.
I have attached an extract from mailmans error log, hope the list will allow it. The error message is:
admin(3051): from Mailman.Handlers.Decorate import decorate admin(3051): File "/var/lib/mailman/Mailman/Handlers/Decorate.py", line 23, in <module> admin(3051): email.charset.CHARSETS['utf-8'] = (SHORTEST, None, 'utf-8') admin(3051): NameError: name 'SHORTEST' is not defined
I have disabled the lines again.
-- Roel Wagenaar,
Linux-User #469851 with the Linux Counter; http://linuxcounter.net/
Antw.: Omdat het de volgorde verstoord waarin mensen tekst lezen. Vraag: Waarom is top-posting een slechte gewoonte? Antw.: Top-posting. Vraag: Wat is het meest ergerlijke in e-mail?
Good judgement comes from experience. Unfortunately, experience comes from bad judgement.

On 11/15/2013 06:11 AM, Roel Wagenaar wrote:
I have adde your lines right after "import re", and almost instantly get the "We hit a bug" message in the web interface.
I have attached an extract from mailmans error log, hope the list will allow it. The error message is:
admin(3051): from Mailman.Handlers.Decorate import decorate admin(3051): File "/var/lib/mailman/Mailman/Handlers/Decorate.py", line 23, in <module> admin(3051): email.charset.CHARSETS['utf-8'] = (SHORTEST, None, 'utf-8') admin(3051): NameError: name 'SHORTEST' is not defined
My bad :(
either of the following should work:
import email.charset email.charset.CHARSETS['utf-8'] = (email.charset.SHORTEST, None, 'utf-8')
or
from email.charset import CHARSETS, SHORTEST CHARSETS['utf-8'] = (SHORTEST, None, 'utf-8')
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Mark Sapiro
-
Roel Wagenaar