Skip to content

imapserver: emit a single untagged SEARCH response instead of chunking by 100#431

Open
pzeinlinger wants to merge 1 commit into
mjl-:mainfrom
pzeinlinger:imap-search-single-response
Open

imapserver: emit a single untagged SEARCH response instead of chunking by 100#431
pzeinlinger wants to merge 1 commit into
mjl-:mainfrom
pzeinlinger:imap-search-single-response

Conversation

@pzeinlinger
Copy link
Copy Markdown

Summary

  • RFC 3501 specifies one untagged * SEARCH response per command, but mox was splitting results into multiple lines of 100 UIDs.
  • Clients built on emersion/go-imap (e.g. aerc) only retain the last untagged SEARCH, so mailboxes with more than 100 matches appeared truncated. Fixes IMAP SEARCH results in multiple responses is a bug #389.
  • Also collapses MODSEQ to a single emission per response, matching RFC 7162's "for all messages being returned" wording.

Test plan

  • New TestSearchSingleResponse appends 101 messages and asserts a single UntaggedSearch event covering all UIDs (red against the old chunked code).
  • Existing search tests still pass.
  • Manual: ran a local mox server, sent 105 messages to mox@localhost, ran UID SEARCH ALL and confirmed a single * SEARCH line.

…g by 100

RFC 3501 specifies one untagged SEARCH response per command, but mox was
splitting the result into multiple lines of 100 UIDs. Clients built on
emersion/go-imap (e.g. aerc) only retain the last untagged SEARCH, so
mailboxes with more than 100 matches appeared truncated. Fixes mjl-#389.

Also collapses MODSEQ to a single emission per response, matching
RFC 7162's "for all messages being returned" wording.
@pzeinlinger pzeinlinger force-pushed the imap-search-single-response branch from fa5285f to 487d091 Compare May 9, 2026 17:51
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.

IMAP SEARCH results in multiple responses is a bug

1 participant