no delivery to lists "wrong" footer characters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Mailman |
Fix Released
|
Medium
|
Mark Sapiro |
Bug Description
Mailman 2.1.8:
I recently had a problem with list administrators
changing the footer to something containing characters
that do not fit the default language for the list.
(Actually it was the result of an upgrade but it can be
reproduced more easily this way.)
This resulted in letters to these lists going to the
archive but not beeing distributed to list members.
After some investigation i discovered that they were
instead getting sent to the shunt directory with the
following error message in logs/error:
Jun 15 16:40:26 2006 (11718) Uncaught runner exception:
ASCII decoding error: ordinal not in range(128)
Jun 15 16:40:26 2006 (11718) Traceback (most recent
call last):
File "/service/
111, in _oneloop
self.
File "/service/
167, in _onefile
keepqueued = self._dispose(
File
"/service/
line 73, in _dispose
self.
File
"/service/
132, in process
Decorate.
File "/service/
line 99, in process
ufooter = unicode(footer, lcset)
UnicodeError: ASCII decoding error: ordinal not in
range(128)
Jun 15 16:40:26 2006 (11718) SHUNTING:
1150382425.
I think this is a very bad idea as it results in the
list administrator complaining to me as site
administrator about letters not being delivered instead
of (for instance) the list members complaing to the
list administrator about unreadable characters in the
footer.
[http://
I think you are correct. I'm not sure about the fix though.
Current code in Decorate.py is (sorry for wrapped lines):
# TK: Try to keep the message plain by converting
oldpayload = msg.get_ payload( decode= True), mcset)
frontsep = endsep = u''
the header/
# footer/oldpayload into unicode and encode with
mcset/lcset.
# Try to decode qp/base64 also.
uheader = unicode(header, lcset)
ufooter = unicode(footer, lcset)
try:
unicode(
I see two approaches to fix this. The first is to change
uheader = unicode(header, lcset)
ufooter = unicode(footer, lcset)
to
uheader = unicode(header, lcset, 'ignore')
ufooter = unicode(footer, lcset, 'ignore')
This will cause the rogue characters to be ignored.
The second approach is to move the
uheader = unicode(header, lcset)
ufooter = unicode(footer, lcset)
try:
inside the try as
try:
uheader = unicode(header, lcset)
ufooter = unicode(footer, lcset)
The result of this will be to add the header and/or footer
in separate MIME parts in this case.
I also thought of using 'replace' instead of 'ignore' in the
first approach, but this will likely result in a
UnicodeError in encode() later on and ultimately have the
same result as the second approach.