mailbox-formats
mailbox-formats
mailbox-formats is a Rust crate for reading and writing classic local mailbox storage formats: mbox variants and Maildir.
Project: https://github.com/planetaryescape/mailbox-formats
Crate: https://crates.io/crates/mailbox-formats
Docs: https://docs.rs/mailbox-formats
Why it exists
Local email storage formats are old, boring, and full of compatibility traps. That makes them exactly the kind of thing a library should make boring for everyone else.
mxr needed export/import-adjacent behavior, but the reusable contract is broader than mxr: parse/write mbox variants, handle Maildir structure, and expose enough control for callers to choose their locking and compatibility policy.
Current mxr use
Validated 2026-06-04: mxr consumes mailbox-formats = "0.1.0" from
crates.io through mxr-export. The latest crates.io release is 0.1.3.
The registry version and the app-consumed version can differ. For mxr docs,
the local manifest and lockfile decide the consumed version.
Validate the local dependency:
cargo tree -p mxr-export -i mailbox-formats
Durable lesson
Some extractions are not "lift the code out." They are "the seed revealed a missing library, now build the library from the spec." That is still a valid extraction when the resulting contract is clearer than the app-specific seed.