Goal
Make on-disk mail interoperable with standard Maildir tooling without losing IMAP UIDs or flags.
Scope
- Canonical tmp/new/cur directories for every mailbox.
- Canonical Maildir++ folders (.Sent, .Drafts, .Junk, etc.) with tmp/new/cur.
- Preserve RFC message bytes, flags, UIDs, UIDVALIDITY, and mailbox identity.
- Provide plan/apply/rollback migration commands.
- Keep compatibility reads during transition.
Acceptance criteria
- Fresh delivery writes through tmp then atomically renames into new.
- Seen/flag changes move files to cur with :2,FLAGS.
- Standard Maildir readers can inspect a migrated fixture.
- Migration is idempotent and collision-safe.
- Production migration preserves message count, hashes, UIDs, and flags.