Describe the bug
Mailboxes containing square brackets in their names sometimes cause the parser to throw an error. In my particular case, it was the mailboxes automatically created by the MacOS email client Airmail (i.e. "INBOX.[Airmail].Snooze").
To Reproduce
Steps to reproduce the behavior:
Connect and authenticate to an IMAP account that contains at least one mailbox containing square brackets in the name.
Attempt to fetch a list of mailboxes using ImapFlow.list()
Observe that sometimes the affected mailbox is omitted from the parsed results, with one or more errors thrown similar to this:
{
src: 's',
msg: '* LIST (\\UnMarked) "." INBOX.[Airmail].Snooze',
err: Error: Unexpected section start char [ at position 29 [E14]
at TokenParser.processString (/Users/foo/project/node_modules/imapflow/lib/handler/token-parser.js:358:41)
at TokenParser.getAttributes (/Users/foo/project/node_modules/imapflow/lib/handler/token-parser.js:33:20)
at ParserInstance.getAttributes (/Users/foo/project/node_modules/imapflow/lib/handler/parser-instance.js:156:34)
at module.exports (/Users/foo/project/node_modules/imapflow/lib/handler/imap-parser.js:44:48)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ImapFlow.reader (/Users/foo/project/node_modules/imapflow/lib/imap-flow.js:478:26) {
code: 'ParserError14',
parserContext: {
input: '(\\UnMarked) "." INBOX.[Airmail].Snooze',
pos: 29,
chr: '['
},
node: 'INBOX.'
},
cid: '11ofrx5prhwu6azae603'
}
Expected behavior
The relevant mailbox(es) should be returned without parser errors.
Desktop (please complete the following information):
Describe the bug Mailboxes containing square brackets in their names sometimes cause the parser to throw an error. In my particular case, it was the mailboxes automatically created by the MacOS email client Airmail (i.e. "INBOX.[Airmail].Snooze").
To Reproduce Steps to reproduce the behavior:
ImapFlow.list()
Expected behavior The relevant mailbox(es) should be returned without parser errors.
Desktop (please complete the following information):