save_attachment
Save one email attachment to a local file on the server's machine and return the file path. Use for large attachments up to 25 MB that are too big to read inline.
Instructions
Write one attachment (up to 25 MB decoded) to a local file on the server's machine and return only its path, keeping the bytes out of the conversation. Use this for attachments too large to read inline with get_attachment. An existing file is never overwritten and no directories are created.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | message uid from list_emails or search_emails | |
| index | Yes | attachment index from list_attachments or get_email | |
| folder | Yes | folder name, as returned by list_folders | |
| output_path | Yes | absolute path to write the decoded attachment to on the server's machine; the parent directory must already exist and the file must not; not available on Windows | |
| uidvalidity | Yes | uidvalidity value returned alongside the uid; detects stale uids |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | the attachment's own filename, which is not where it was written | |
| saved_path | Yes | symlink-resolved path the attachment was written to | |
| content_type | Yes | ||
| decoded_size_bytes | Yes | bytes written to disk | |
| encoded_size_bytes | Yes |