Add complete, restart-safe UIDONLY acquisition - #334
Closed
gabeosx wants to merge 4 commits into
Closed
Conversation
This was referenced Jul 29, 2026
Author
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
Add a separate UIDONLY acquisition path for servers that advertise RFC 9586,
while preserving Bichon's existing acquisition path for other servers.
The new path:
UIDNEXT - 1;canonical mailbox, UIDVALIDITY, and UID;
cancellation, and disk limits;
attachment, and Tantivy path;
lifecycle deletion.
Why
This implements the Bichon part of #333.
The existing full-mailbox path plans work from mutable message sequence
numbers. An expunge between pages can shift later sequence numbers and leave a
message behind. Existing progress tracking can also advance to a higher UID
after a lower message was omitted, oversized, interrupted, or only queued for
storage. Once the saved cursor moves above that message, later runs may never
request it again.
That mechanism is relevant to the incomplete Yahoo archives reported in #286
and #271, and to the interrupted-acquisition case in #255.
Dependency stack
This draft depends on:
For reproducible review, Bichon currently pins the exact feature commit
905a005234f89d046c2f439cee27daf947917b41fromgabeosx/async-imap, which inturn pins parser commit
05439a90033d67297892c3fe206b8c4285df3821.Those temporary sources should be replaced with the accepted Rustmailer commits
or releases before this PR merges.
Behavior worth calling out
expanded into millions of UIDs.
UID checkpoint.
date-bounded UID inventory has not yet been defined. It will not silently
claim a complete snapshot.
Tests
Against the exact dependency commits above:
cargo check -p bichon-core --no-default-features --offline --lockedignored
The deterministic coverage includes expunge between inventory pages, sparse
UIDs, omitted and oversized messages, disconnect/reconnect, pending restart,
UIDVALIDITY changes, identical bodies, malformed or overfull PARTIAL responses,
MESSAGELIMIT handling, huge VANISHED ranges, pre-literal response ceilings,
runtime/cancellation/disk limits, canonical-write rollback, and lifecycle
cleanup.
The Cyrus harness builds a pinned, checksum-verified server, uses a random
localhost port and disposable volumes, provisions three synthetic messages,
and cleans up the container, volumes, image, and temporary archive when done.
A fresh GitHub clone of this branch also completed the locked build, fake-server
suite, exact-raw production-storage test, and a newly provisioned Cyrus run.