I've looked a little closer into this.
Attached is the patch to mailgw that sends the traceback in addition to
the mail problem report -- just if you want to debug this yourself.
The problem is in roundup core and is related to parsing of
message/rfc822 attachments -- when sending out the result of such a
message we generate a binary (base64 encoded) attachment and manually
set the mime type to message/rfc822. The serialisation of the email
module expects a list for this mime type and crashes.
Now this raises the question of how to handle message/rfc822 attachments:
- just attach the thing as binary encoded message -- will not be of
much use to a user of the web interface, but maybe we can come up
with a creative way of handling message/rfc822 at the browser side
- look into the message and parse the parts contained in it, attach
these parts to the issue. Downside: Relation to the original email
attachment gets lost but we have this problem anyway with deeply
nested attachment structures (e.g. multipart/mixed).
Does it often happen in your environment that you send mails to roundup
which contain an email attachment?
For Reference the traceback, note that this happens in the nosyreactor
when we want to *send out* the email attachment we received:
Traceback (most recent call last):
File "/usr/local/lib/python2.5/site-packages/roundup/mailgw.py", line
1377, in _handle_message
cl.set(nodeid, **props)
File
"/usr/local/lib/python2.5/site-packages/roundup/backends/rdbms_common.py",
line 1602, in set
self.fireReactors('set', nodeid, oldvalues)
File "/usr/local/lib/python2.5/site-packages/roundup/hyperdb.py", line
1230, in fireReactors
react(self.db, self, nodeid, oldvalues)
File "./detectors/nosyreaction.py", line 56, in nosyreaction
cl.nosymessage(nodeid, msgid, oldvalues)
File "/usr/local/lib/python2.5/site-packages/roundup/roundupdb.py",
line 286, in nosymessage
bcc_sendto)
File "/usr/local/lib/python2.5/site-packages/roundup/roundupdb.py",
line 513, in send_message
mailer.smtp_send(sendto + bcc_sendto, message.as_string())
File "/usr/lib/python2.5/email/message.py", line 131, in as_string
g.flatten(self, unixfrom=unixfrom)
File "/usr/lib/python2.5/email/generator.py", line 84, in flatten
self._write(msg)
File "/usr/lib/python2.5/email/generator.py", line 109, in _write
self._dispatch(msg)
File "/usr/lib/python2.5/email/generator.py", line 135, in _dispatch
meth(msg)
File "/usr/lib/python2.5/email/generator.py", line 201, in
_handle_multipart
g.flatten(part, unixfrom=False)
File "/usr/lib/python2.5/email/generator.py", line 84, in flatten
self._write(msg)
File "/usr/lib/python2.5/email/generator.py", line 109, in _write
self._dispatch(msg)
File "/usr/lib/python2.5/email/generator.py", line 135, in _dispatch
meth(msg)
File "/usr/lib/python2.5/email/generator.py", line 266, in _handle_message
g.flatten(msg.get_payload(0), unixfrom=False)
File "/usr/lib/python2.5/email/message.py", line 185, in get_payload
raise TypeError('Expected list, got %s' % type(self._payload))
TypeError: Expected list, got <type 'str'> |