Roundup Tracker - Issues

Issue 2551066

classification
Traceback in email gateway
Type: crash Severity: normal
Components: Mail interface Versions: 2.0.0alpha
process
Status: closed fixed
:
: schlatterbeck : rouilj, schlatterbeck
Priority: : NeedsTesting

Created on 2019-10-09 13:59 by schlatterbeck, last changed 2024-05-03 11:21 by schlatterbeck.

Messages
msg6719 Author: [hidden] (schlatterbeck) Date: 2019-10-09 13:59
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?
msg6720 Author: [hidden] (rouilj) Date: 2019-10-09 14:30
Hi Ralf:

Email interfaces other than pipe and mailbox are untested
post python3 conversion.

See: https://issues.roundup-tracker.org/issue2550974

I have that as one of my CTA in the 2.0.0alpha announcements.

-- rouilj
msg6721 Author: [hidden] (schlatterbeck) Date: 2019-10-09 16:21
Pushed a fix in 7264b2e79a31
Adding a test is hard as it would have to somehow emulate imap (or
instrument the imap handling somehow).

Anybody could give this a check?
Works for me for now with python2, tested also with python3 in debug mode.

Leaving this open for now, should get some more testing.
msg6767 Author: [hidden] (rouilj) Date: 2019-10-25 00:10
I requested assistance in testing this in the 2.0.0alpha0 release notes.
msg7721 Author: [hidden] (rouilj) Date: 2023-02-20 00:21
Ralf any ideas on testing this, or are you satisfied that it is fixed at this point?

If you are happy with it can you close it.
msg7767 Author: [hidden] (rouilj) Date: 2023-05-20 19:37
Ralf any conclusion on this?
msg7986 Author: [hidden] (rouilj) Date: 2024-04-16 02:06
Ping Ralf. Any final thoughts on this?
msg8020 Author: [hidden] (rouilj) Date: 2024-05-01 01:23
Closing as abandoned.
msg8033 Author: [hidden] (schlatterbeck) Date: 2024-05-03 11:21
Sorry for not following up on this: I have no good idea how to offline test this in a test harness. But after my fix it has not re-occurred. Note that in the meanwhile all my tracker instances are python3 and afair this was originally a python2 issue.

So I've set the resolution to 'fixed'.

Thanks John for the persistence and again sorry for neglecting to answer this.

Ralf
History
Date User Action Args
2024-05-03 11:21:08schlatterbecksetresolution: abandoned -> fixed
messages: + msg8033
2024-05-01 01:23:22rouiljsetstatus: open -> closed
resolution: remind -> abandoned
messages: + msg8020
2024-04-16 02:06:17rouiljsetmessages: + msg7986
2023-05-20 19:37:48rouiljsetmessages: + msg7767
2023-02-20 00:21:00rouiljsetstatus: pending -> open
messages: + msg7721
2019-12-22 01:02:41rouiljsetstatus: open -> pending
2019-10-25 00:10:30rouiljsetmessages: + msg6767
2019-10-20 21:35:19rouiljsetkeywords: + NeedsTesting
resolution: fixed -> remind
2019-10-11 01:59:58rouiljsettype: crash
2019-10-09 16:21:25schlatterbecksetstatus: new -> open
resolution: fixed
messages: + msg6721
2019-10-09 14:30:05rouiljsetnosy: + rouilj
messages: + msg6720
2019-10-09 13:59:19schlatterbeckcreate