Roundup Tracker - Issues

Message4127

Author schlatterbeck
Recipients benni, schlatterbeck
Date 2010-09-08.10:17:33
Message-id <1283941054.75.0.609686066493.issue2550667@psf.upfronthosting.co.za>
In-reply-to
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'>
History
Date User Action Args
2010-09-08 10:17:34schlatterbecksetmessageid: <1283941054.75.0.609686066493.issue2550667@psf.upfronthosting.co.za>
2010-09-08 10:17:34schlatterbecksetrecipients: + schlatterbeck, benni
2010-09-08 10:17:34schlatterbecklinkissue2550667 messages
2010-09-08 10:17:33schlatterbeckcreate