Save an attachment
save_attachmentWrite email attachments to a local folder and return their paths. Ephemeral files self-delete after a short TTL; set persist to keep them permanently.
Instructions
Write attachment(s) to disk and return the path(s). Use for images, scanned PDFs, or anything not text-extractable. EPHEMERAL by default — files self-delete after the TTL.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | ||
| folder | No | Default INBOX. | |
| dry_run | No | Preview exactly what would happen and change nothing. Needs no confirmation. | |
| persist | No | Keep the file permanently. Default false = auto-deleted after the TTL so nothing lingers for the user to open by accident. | |
| dest_dir | No | Sub-path under the attachments dir. Writes outside it are refused. | |
| filename | No | Partial match; omit to save all documents. | |
| uidvalidity | No | UIDVALIDITY reported alongside the uid. Pass it back so a mailbox resync cannot make this act on the wrong message. | |
| include_inline | No |