Roundup Tracker - Issues

Message6719

Author schlatterbeck
Recipients schlatterbeck
Date 2019-10-09.13:59:19
Message-id <1570629559.93.0.753003368211.issue2551066@roundup.psfhosted.org>
In-reply-to
With python2 I'm getting a traceback in the email gateway when
processing an IMAP mailbox:

roundup@tux5:~$ roundup-mailgw /var/lib/tracker/tracker-home/ imap
tracker@example.com:verysecret@tux2
Traceback (most recent call last):
  File "/usr/local/bin/roundup-mailgw", line 6, in <module>
    run()
  File
"/usr/local/lib/python2.7/dist-packages/roundup/scripts/roundup_mailgw.py",
line 226, in run
    sys.exit(main(sys.argv))
  File
"/usr/local/lib/python2.7/dist-packages/roundup/scripts/roundup_mailgw.py",
line 220, in main
    cram)
  File "/usr/local/lib/python2.7/dist-packages/roundup/mailgw.py", line
1363, in do_imap
    self.handle_Message(message_from_bytes(s, RoundupMessage))
  File "/usr/lib/python2.7/email/__init__.py", line 57, in
message_from_string
    return Parser(*args, **kws).parsestr(s)
  File "/usr/lib/python2.7/email/parser.py", line 82, in parsestr
    return self.parse(StringIO(text), headersonly=headersonly)
TypeError: StringIO() argument 1 must be string or buffer, not _io.BytesIO


It looks to me like a BytesIO instance is passed to the email package
message_from_string (aliased in roundup to message_from_bytes for
python2) instead of bytes, so this should use getvalue() on the BytesIO
instance for passing to the email Parser.

Didn't anybody use the email gateway so far?
I wonder how this could last so long without being detected?
History
Date User Action Args
2019-10-09 13:59:19schlatterbecksetrecipients: + schlatterbeck
2019-10-09 13:59:19schlatterbecksetmessageid: <1570629559.93.0.753003368211.issue2551066@roundup.psfhosted.org>
2019-10-09 13:59:19schlatterbecklinkissue2551066 messages
2019-10-09 13:59:19schlatterbeckcreate