ReviewOS

mail-os/mail

Adopt canonical Maildir++ layout with safe migration

#5
Closed chris opened this 9 days ago ·
9 days ago

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.
9 days ago

Implemented in commit 9f7fb90 and tracked in draft PR #8.

Production migration completed for 31 mailboxes and 67 folders. Canonical .Folder/{tmp,new,cur} directories, compatibility links, ownership, and 0700 permissions were verified. The migration is idempotent and handles flat, nested, and partially migrated layouts. IMAP CREATE/DELETE/RENAME now maintain the canonical layout; the full Zig suite and Linux release build pass.

Sign in to comment on this issue.