mail-threading
mail-threading
mail-threading is a Rust crate for client-side email threading using JWZ / RFC 5256-style message references.
Project: https://github.com/planetaryescape/mail-threading
Crate: https://crates.io/crates/mail-threading
Docs: https://docs.rs/mail-threading
Why it exists
Thread reconstruction is deceptively small. The easy version reads In-Reply-To and References. The hard version handles missing parents, duplicated message IDs, subject fallback, cycle prevention, ordering, and provider-native thread IDs.
That is too much policy and test surface to leave as copy-pasted app code. The crate makes the portable threading contract testable outside Mxr.
Current mxr use
Validated 2026-06-04: mxr consumes mail-threading = "0.1.0" from crates.io
in mxr-sync. The latest crates.io release is 0.1.3.
mxr does not automatically move just because a package has a newer registry
release. The app-consumed version changes only when the mxr manifest or lockfile
changes.
Validate the local dependency:
cargo tree -p mxr-sync -i mail-threading
Validate the integration point:
rg -n "mail_threading|thread_messages|native_threading" crates/sync
Durable lesson
Provider-native IDs and client-side reconstruction can coexist. The internal model should preserve provider truth when it exists and fall back to portable reconstruction only where the provider cannot do the work.