# ADR 0009: Restore mail from Exchange's own export, kept beside the .eml - **Status:** Accepted - **Date:** 2026-12-03 ## Context Each message is backed up as its original MIME (`.eml`), which anyone can open and which the browse view reads. Graph can create a message from MIME, but the result is a draft unless undocumented MAPI properties are set, and Exchange rebuilds the message from the MIME, so some properties (read state, flags, categories, some dates) can differ from the original. Graph's mailbox import/export API (v1.0, generally available since May 2026) exports a message as an opaque, full-fidelity stream that only Exchange can read, and imports that stream into any folder of the same or another mailbox. It cannot convert to or from MIME. Microsoft says these APIs "aren't designed for mailbox backup and restore"; they are, however, the only full-fidelity way in and out of a mailbox through Graph. ## Decision Keep both. Backups go on storing the `.eml`; after each mailbox's backup, the core asks the module for a **restore copy** (Exchange's export stream) of every current message that has none, and stores it with that version (`content.extra.fts`). Restore imports the restore copy. The SDK hook is generic (`BackupModule.extra_copies()` / `fetch_extras()`), so other modules can keep a second form of an item too. Retention, the repository check and folder moves treat extra copies as part of the version. ## Consequences - Mail storage roughly doubles. - The Backup app needs `MailboxItem.Export.All`; the Restore app needs `MailboxItem.ImportExport.All`, `MailboxFolder.ReadWrite.All` and `User.Read.All`. Until the tenant is updated, backups succeed without restore copies. - Messages backed up earlier get restore copies on the next run (one export request per 20 messages), so the first run after the change is longer. - A changed message gets a new copy; a message only moved between folders keeps its copy. - If Microsoft changes or withdraws the API, the `.eml` is still there for export, and a MIME-based restore can be added as a fallback. - Not covered by the API yet: archive mailboxes, group mailboxes, public folders (none of which are backed up today).