Fix QRESYNC VANISHED fetch for highest expunged UID#73
Open
HeyGuido wants to merge 1 commit into
Open
Conversation
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.
This fixes an ActiveSync/QRESYNC issue where externally expunged messages may not be detected when using Cyrus IMAP as backend.
SOGo/SOPE currently detects VANISHED messages using:
UID FETCH 1:* (UID) (CHANGEDSINCE VANISHED)
With Cyrus IMAP, * is resolved to the highest currently visible UID in the mailbox. If the expunged message previously had the highest UID, it is now above the resolved 1:* range and Cyrus returns no VANISHED response.
As a result, SOGo does not emit a delete command to the ActiveSync client, but the SyncKey is still advanced past the expunge modseq. The deletion is then permanently missed by the device until a full folder resync.
Using an explicit maximum UID range fixes this:
UID FETCH 1:4294967295 (UID) (CHANGEDSINCE VANISHED)
Tested with:
SOGo 5.x nightly
Cyrus IMAP 3.8.2
iOS/iPadOS Mail as ActiveSync client
This reliably fixes deletions and moves performed outside of ActiveSync, for example via IMAP or the SOGo web UI.
I have also opened a corresponding Cyrus IMAP issue for the backend-side behavior:
cyrusimap/cyrus-imapd#6071