Bug on mailman 2.1.1 with non ascii mails?

I have a problem with mailman 2.1.1 (Debian package 2.1.1-4)
The OutgoingRunner was failing as follows: Traceback (most recent call last): File "/var/lib/mailman/bin/qrunner", line 270, in ? main() File "/var/lib/mailman/bin/qrunner", line 230, in main qrunner.run() File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 59, in run filecnt = self._oneloop() File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 114, in _oneloop self._doperiodic() File "/usr/lib/mailman/Mailman/Queue/OutgoingRunner.py", line 136, in _doperiodic mlist.registerBounce(recip, msg) File "/var/lib/mailman/Mailman/Bouncer.py", line 155, in registerBounce self.disableBouncingMember(member, info, msg) File "/var/lib/mailman/Mailman/Bouncer.py", line 165, in disableBouncingMember self.__sendAdminBounceNotice(member, msg) File "/var/lib/mailman/Mailman/Bouncer.py", line 187, in __sendAdminBounceNotice lang=self.preferred_language) File "/var/lib/mailman/Mailman/Message.py", line 203, in __init__ self['Subject'] = Header(subject, charset, header_name='Subject') File "/var/lib/mailman/pythonlib/email/Header.py", line 164, in __init__ self.append(s, charset) File "/var/lib/mailman/pythonlib/email/Header.py", line 230, in append ustr = unicode(s, incodec) UnicodeError : ASCII decoding error: ordinal not in range(128)
In that line there was a: ustr = unicode(s, ustr = unicode(s, incodecincodec)
And the incodec was set on line 229 as: incodec = charset.input_codec or 'us-ascii'
It seems that charset.input_codec was not set, and the pending to send emails were not us-ascii code. I have to change that line to: incodec = charset.input_codec or 'iso-8859-15' And also change the line 234:
- outcodec = charset.output_codec or 'us-ascii'
- outcodec = charset.output_codec or 'iso-8859-15'
and the OutgoingRunner was able then to process the emails without hanging.
Is important to make more checks, to avoid DOS atacks to mailman servers. A message with non-ascii chars could be considered as ascii making the OutgoingRunner to die, and stoping the service.
This only happens if: if isinstance(s, StringType): because the exception is not caught
later the the conversion is done properly capturing the exception: elif isinstance(s, UnicodeType): for charset in USASCII, charset, UTF8: try: outcodec = charset.output_codec or 'us-ascii' s = s.encode(outcodec) break except UnicodeError: ...
How you think this should be solved? I'm not and expert in python...
--
,,,.. .-.
/ -_.' ' ""
,/ ,/, / , ,
, , ``-,
, , , )
PAZ SÍ /,,' ,/ ,/ /
¡GUERRA NO! , / bisho! -=] 15/04/2003 [=-

On Tue, 2003-04-15 at 00:06, Guille -bisho- wrote:
I have a problem with mailman 2.1.1 (Debian package 2.1.1-4)
How you think this should be solved? I'm not and expert in python...
As a general rule, whenever you have a message that is crashing a qrunner, the /only/ way to debug it properly is to submit a SF bug report and upload the offending message on the report. Then I can download it and run it on the cvs snapshot to see if the problem has been fixed or not.
Be sure that when you upload the message, it has been properly sanitized. The SF tracker is a public forum and I may need to add the message (or a portion of it) to a test suite.
Cheers, -Barry
participants (2)
-
Barry Warsaw
-
Guille -bisho-