When parsing response from imap server, it should consider whether the response token is imap quoted string or not.
e.g.
If I send LIST command and expected mailbox name is mailbox_"important"_, imap server would give that name as "mailbox_\"important\"_"(converted to imap quoted string).
$ openssl s_client -connect imap.gmail.com:993 -quiet -crlf
... # imap login
2 LIST "" "*" # request LIST command
# receive response
... # other mailboxes
* LIST (\HasNoChildren) "/" "mailbox_\"important\"_" # mailbox_"important"_ -> mailbox_\"important\"_
... # other mailboxes
2 OK Success # tagged response
Current mailio::imap::parse_response function may split mailbox name into mailbox_\, important\ and _ since it doesn't consider imap quoted string format.
then mailio::imap::list_folder function would raise exception since token size is invalid(more than 3).
Related issue
134
Suggestion
When parsing response from imap server, it should consider whether the response token is imap quoted string or not.
e.g. If I send
LIST
command and expected mailbox name ismailbox_"important"_
, imap server would give that name as"mailbox_\"important\"_"
(converted to imap quoted string).Current
mailio::imap::parse_response
function may split mailbox name intomailbox_\
,important\
and_
since it doesn't consider imap quoted string format. thenmailio::imap::list_folder
function would raise exception since token size is invalid(more than 3).