IMAP.status doesn't work when mailbox name contains a space#101
Conversation
|
@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 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: 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. |
f95aeea to
4a41c84
Compare
|
@mpscholten looks great thanks! I'm happy to merge when undrafted :) |
|
Thanks! It is ready for review now :) |
|
@mpscholten thanks for the work and patience. I'll try to make a release (but possibly will be able to only after/or during Zurihac) |
|
thanks 👍 I have some more patches coming Will be at Zurihac tomorrow as well (already at HIW right now) |
Fixes
pStatusLineso it consumes the mailbox name as either an unquoted atom or a quoted string with escaped characters before parsing the status list.This addresses qnikst's review feedback: the previous patch handled spaces but still stopped too early when a quoted mailbox contained an escaped double quote.
Also enables the existing
imap-parsersHUnit test suite in Cabal and updates the repository URL fromgit://tohttps://so currentcabal checkpasses.Regression coverage:
STATUS "[Gmail]/Alle Nachrichten" ...STATUS "foo\" bar" ...Validation:
cabal test imap-parsers --test-show-details=directfailed on the quoted mailbox cases.nix shell nixpkgs#cabal-install nixpkgs#ghc --command cabal test imap-parsers --test-show-details=directnix shell nixpkgs#cabal-install nixpkgs#ghc --command cabal build allnix shell nixpkgs#cabal-install nixpkgs#ghc --command cabal check(only the existingCHANGELOGdoc-place warning remains)git diff --check