Email Get Attachment
email_get_attachmentRetrieve email attachments from iCloud Mail by message ID and attachment name or index. Save the file to a chosen directory or receive it inline.
Instructions
Download an email attachment.
With save_dir the file is written to disk and its path returned; otherwise the file is returned inline (images as image content, other types as an embedded resource).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | No | IMAP folder name. iCloud folders: INBOX, Drafts, 'Sent Messages', 'Deleted Messages', Junk, Archive (see email_list_folders). | INBOX |
| save_dir | No | Directory on the machine running this server to save the file into. Recommended when running locally (stdio). When omitted the file content is returned inline. | |
| attachment | Yes | Attachment index ('1') or (partial) file name as listed by email_get_message. | |
| message_id | Yes | Message ID (IMAP UID) from email_list_messages/email_search, valid within `folder` only. |