fix(imap4): accept SORT data when server returns tagged NO#71
Open
bakgaard wants to merge 1 commit intoAlinto:masterfrom
Open
fix(imap4): accept SORT data when server returns tagged NO#71bakgaard wants to merge 1 commit intoAlinto:masterfrom
bakgaard wants to merge 1 commit intoAlinto:masterfrom
Conversation
Dovecot may return valid SORT results in an untagged response but then send a tagged NO (e.g. "Requested sort would have taken too long"). The sort data is still valid and usable. Previously, normalizeSortResponse relied solely on the tagged response status, discarding perfectly good sort data when the server returned NO. This caused SOGo's mail view to fail with "could not sort contents of URL" on large mailboxes served by Dovecot instances with aggressive sort-time policies. Now, if sort data was received in the untagged response, the result is promoted to success regardless of the tagged status. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
|
Issue found with 2338 mails in inbox. This made it work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
* SORTresponse but then send a taggedNO(e.g. "Requested sort would have taken too long")normalizeSortResponserelied solely on the tagged response status, discarding perfectly good sort datacould not sort contents of URLon large mailboxes (2000+ messages) served by Dovecot instances with aggressive sort-time policiesFix
If sort data was received in the untagged response, promote the result to success regardless of the tagged status. This is a minimal, safe change — it only affects the SORT normalizer and only when data was actually returned.
Reproduction
mail_sort_max_timeor similar policy limitsUID SORT (REVERSE ARRIVAL) UTF-8 NOT DELETED* SORT <all UIDs>followed by taggedNO Requested sort would have taken too longTest plan
🤖 Generated with Claude Code