export_mail
Exports selected mail messages as importable .eml files directly from disk, without launching Mail or using Automation, so you can archive or open them elsewhere.
Instructions
Write messages out as importable .eml files (Full Disk Access).
Read AT REST — the same on-disk bytes the undo backups copy — so this never
launches Mail and needs no Automation. ids are RFC822 message-ids from a mail
read, comma-separated, max 25. dest_dir must be inside the allowed root
(~/Downloads by default; MACOS_APPS_FILE_ROOT moves it) and is created if needed;
a path outside it is REFUSED. Filenames are derived, never overwritten. A name that
already exists refuses the whole batch before any file is written; a refusal after
a write names the files already written.
.eml is the only format — it is lossless and opens in Mail and everything else,
and mail_body already covers "give me the text".
Returns {results, written, dest_dir, plane}. A message with no local file is
reported per-id as status: "absent" rather than failing the batch.
fidelity: "partial" means the .eml is missing its ATTACHMENT payloads — the body
is complete (#119). It is lossy for archival, not for reading.
Additive: writes new files, never overwrites or modifies mail.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | Yes | ||
| dest_dir | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||