save-attachment
Save an email attachment to a local folder by providing the message ID, attachment name, and target directory. Ensures the path is within allowed roots and returns the saved file location.
Instructions
Use when: writing one of a message's attachments to disk, by message id and attachmentName, into the savePath directory (saved as savePath/attachmentName). Returns: a confirmation of the saved file path. Do not use when: you don't know the attachment name (use list-attachments first) or want the bytes inline rather than on disk (use fetch-attachment). Safety: writes a file to disk — savePath must be a directory inside the configured allowed roots, and attachmentName may not contain path separators or '..'; calls outside those constraints are rejected.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| savePath | Yes | ||
| attachmentName | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| savedPath | No | ||
| attachmentName | No |