do_list
crashes when encountering a mailbox containing a [
(but no closing bracket)
#583
Labels
do_list
crashes when encountering a mailbox containing a [
(but no closing bracket)
#583
There's this situation where the parser in imapclient crashes on the response of a LIST command (from dovecot) when there is a mailbox with a name contains an (unclosed) opening square bracket.
I stared at the code but could not find an easy fix :(
This test case (added to TestParseResponse) shows what I was hoping to achieve:
This test case was inspired by debug output of our own webmail application tests, where such a folder gets created, and then the following untagged responses are returned from dovecot:
This test fails with the following traceback:
(I cross referenced this against the grammar in rfc3501 and
bar[baz
is a valid astring, which in turn is allowed in the mailbox part of LIST responses)I'm now contemplating implementing a custom parser for LIST responses; would that be an acceptable solution?
The text was updated successfully, but these errors were encountered: