download_attachment
Saves a selected NetEase Mail attachment to the allowed download directory or its subdirectory, validates paths, avoids overwrites, and returns file metadata plus a text excerpt.
Instructions
Save one attachment into the download dir (NETEASE_MAIL_DOWNLOAD_DIR) or a subdirectory of it: sanitized name, never overwrites or follows links, file mode 0600, marked as downloaded (macOS quarantine / Windows Zone.Identifier), ≤50 MB. Returns path, size, sha256, content_type, and a text excerpt for text/csv/json/md files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Message id. | |
| index | No | Attachment index from read_message. | |
| dest_dir | No | Subdirectory of the download dir to save into (relative, or an absolute path inside it). Anything outside the download dir is refused. | |
| filename | No | Or the attachment filename. |