Skip to content

Regression test for Office365/Exchange trailing FETCH fields (#15)#114

Merged
qnikst merged 1 commit into
qnikst:masterfrom
mpscholten:regression-test-imap-15-office365
Jun 14, 2026
Merged

Regression test for Office365/Exchange trailing FETCH fields (#15)#114
qnikst merged 1 commit into
qnikst:masterfrom
mpscholten:regression-test-imap-15-office365

Conversation

@mpscholten

@mpscholten mpscholten commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

What

Adds a regression test for #15 — Office365 and Exchange append UID nn FLAGS (\Seen) after the BODY[] literal, before the closing ). The old Parsec FETCH parser rejected this with expected space or ).

The streaming FETCH parser introduced in #111 already tolerates trailing fields (it loops consuming key/value pairs until )), so IMAP.fetch now returns the body correctly. This test locks the behaviour in by feeding the exact wire shape from the issue through IMAP.fetch via the mock stream:

* 12 FETCH (BODY[] {nnn}
<body bytes>
 UID 12 FLAGS (\Seen))
000004 OK FETCH completed.

Also

Fixes the stale append preserves raw crlf message bytes expectation. Since the mailbox-quoting change (0e242d9), APPEND correctly quotes the mailbox name ("INBOX"), but that test still expected the unquoted form and was failing on master. Expectation updated to match.

Verification

cabal test imap-parsers — 48/48 pass (was 47 with 1 pre-existing failure).

🤖 Generated with Claude Code

Closes #15

…kst#15)

Office365 and Exchange append "UID nn FLAGS (\Seen)" after the BODY[]
literal, before the closing ')'. The old Parsec FETCH parser rejected
this with "expected space or )". The streaming parser introduced in qnikst#111
already tolerates it; this locks the behaviour in with a test feeding the
exact wire shape from qnikst#15 through IMAP.fetch.

Also fixes the stale "append preserves raw crlf message bytes"
expectation: APPEND now quotes the mailbox name ("INBOX") since the
mailbox-quoting change, so the test expectation is updated to match. The
suite is green again (48/48).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mpscholten

Copy link
Copy Markdown
Contributor Author

@qnikst this one is ready as well :)

@qnikst

qnikst commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Looks great, thanks!

@qnikst qnikst merged commit 7cdc854 into qnikst:master Jun 14, 2026
23 checks passed
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.

Parse error on Office365 accounts

2 participants