Skip to content

Quote and encode IMAP mailbox names#108

Open
mpscholten wants to merge 3 commits into
qnikst:masterfrom
mpscholten:upstream/imap-mailbox-quoting
Open

Quote and encode IMAP mailbox names#108
mpscholten wants to merge 3 commits into
qnikst:masterfrom
mpscholten:upstream/imap-mailbox-quoting

Conversation

@mpscholten

@mpscholten mpscholten commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Follow-up for IMAP mailbox handling. This is based on upstream master after #101 merged, so the remaining diff is focused on mailbox quoting, modified UTF-7 handling, and the related tests.

Changes:

  • quote and escape mailbox names in public mailbox commands (SELECT, EXAMINE, CREATE, DELETE, RENAME, SUBSCRIBE, UNSUBSCRIBE, STATUS, APPEND, COPY, MOVE)
  • encode mailbox command arguments with IMAP modified UTF-7
  • decode modified UTF-7 mailbox names returned by LIST/LSUB
  • add focused parser/API regression tests
  • wire the new UTF-7 module and test dependencies

Regression coverage:

  • command bytes for quoted mailbox names with spaces and quotes
  • command bytes for Entwürfe -> Entw&APw-rfe
  • command bytes for A&B -> A&-B
  • LIST decoding for Entw&APw-rfe and A&-B

Before wiring the fix, cabal test imap-parsers --test-show-details=direct failed on the new command-byte and LIST decoding tests.

Validation:

  • nix shell nixpkgs#cabal-install nixpkgs#ghc --command cabal test imap-parsers --test-show-details=direct
  • nix shell nixpkgs#cabal-install nixpkgs#ghc --command cabal build all
  • nix shell nixpkgs#cabal-install nixpkgs#ghc --command cabal check (only the existing CHANGELOG doc-place warning remains)
  • git diff --check

Relationship to #101:

@mpscholten mpscholten marked this pull request as ready for review June 5, 2026 14:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aaa892f8bd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Network/HaskellNet/IMAP.hs
@mpscholten mpscholten force-pushed the upstream/imap-mailbox-quoting branch from cbfe450 to 0e242d9 Compare June 5, 2026 14:38
…ox-quoting

# Conflicts:
#	test/IMAPParsersTest.hs
@mpscholten

Copy link
Copy Markdown
Contributor Author

@qnikst any thoughts on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant