IMAP.status doesn't work when mailbox name contains a space
The pStatusLine parser parses until it hits a space. When we have a mailbox like [Gmail]/Alle Nachrichten, it will not consume the full mailbox name
@qnikst could you take a look at this? (and if you're on this maybe also the other open PR) :)
Hello! Thanks for the patch, but I expect that it would need some more love, but correct me if I'm wrong.
I was not able to get through all the RFC, but I expect that in case if mailbox has special characters like spaces it MUST be quoted, and if there is already a double quote in the protocol it has to be escaped by the \ symbol. If this is correct then the current approach is only a partial solution: it does indeed fix the case of spaces, but does not fix it for the case if there are double quotes in the mailbox.
If you already have a good system to test and check the fix can you please try that case?
I'd suggest using something like:
unquote `manyTill` char '"' ... where
unquote = asum [ char '\' >> anyChar, anyChar]
This way we will be able to consume a quoted double quote and return it from the parser and will not stop before we needed.