apple-mail
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseApple Mail Skill
Apple Mail Skill
Search, read, and extract attachments from Apple Mail's local storage on macOS.
在macOS上搜索、读取并提取Apple Mail本地存储中的附件。
Tool
工具
apple-mail.sh.emlxapple-mail.sh.emlxQuick Reference
快速参考
bash
TOOL=~/Development/agent-stuff/skills/apple-mail/apple-mail.shbash
TOOL=~/Development/agent-stuff/skills/apple-mail/apple-mail.shSearch emails
Search emails
$TOOL search --from "peter@" --subject "dinner" --limit 5
$TOOL search --after 2026-02-01 --has-attachment
$TOOL search --body "invoice" --mailbox "INBOX" --unread
$TOOL search --to "armin@" --before 2025-12-31
$TOOL search --from "peter@" --subject "dinner" --limit 5
$TOOL search --after 2026-02-01 --has-attachment
$TOOL search --body "invoice" --mailbox "INBOX" --unread
$TOOL search --to "armin@" --before 2025-12-31
Show message metadata, recipients, attachments, and summary
Show message metadata, recipients, attachments, and summary
$TOOL info 783660
$TOOL info 783660
Read the raw RFC822 email (headers + body)
Read the raw RFC822 email (headers + body)
$TOOL read 783660
$TOOL read 783660
Extract attachments to a temp directory (prints the path)
Extract attachments to a temp directory (prints the path)
$TOOL attachment 783660 # all attachments
$TOOL attachment 783660 "Rechnung.pdf" # specific file
$TOOL attachment 783660 # all attachments
$TOOL attachment 783660 "Rechnung.pdf" # specific file
List all mailboxes with counts
List all mailboxes with counts
$TOOL mailboxes
undefined$TOOL mailboxes
undefinedSearch Options
搜索选项
| Flag | Description |
|---|---|
| Sender address substring |
| Recipient address substring |
| Subject substring |
| Body/summary text substring |
| Mailbox URL substring (e.g. |
| Received after date |
| Received before date |
| Only unread messages |
| Only flagged messages |
| Only messages with attachments |
| Max results (default: 20) |
| 标记 | 描述 |
|---|---|
| 发件人地址子串 |
| 收件人地址子串 |
| 主题子串 |
| 正文/摘要文本子串 |
| 邮箱URL子串(例如 |
| 接收日期晚于指定日期 |
| 接收日期早于指定日期 |
| 仅显示未读邮件 |
| 仅显示已标记邮件 |
| 仅显示包含附件的邮件 |
| 最大结果数(默认:20) |
Output Format
输出格式
- returns pipe-delimited table with header row:
searchid|sender|sender_name|subject|received|status|flagged|mailbox|attachments - returns structured metadata sections
info - outputs raw RFC822 email to stdout
read - prints the temp directory path to stdout, file listing to stderr
attachment
- 返回带表头的竖线分隔表格:
searchid|sender|sender_name|subject|received|status|flagged|mailbox|attachments - 返回结构化的元数据章节
info - 将原始RFC822格式邮件输出到标准输出
read - 将临时目录路径输出到标准输出,文件列表输出到标准错误
attachment
Notes
注意事项
- Message IDs are Apple Mail internal ROWIDs (integers), shown in the column
id - files contain headers only (body not downloaded);
.partial.emlxwarns about thisread - Attachments are copied to a temp directory under ; clean up when done
/tmp/ - The search queries the
bodytable (Apple Mail's plaintext preview), not the full email bodysummaries - Mailbox URLs are percent-encoded (e.g., =
%5BGmail%5D,[Gmail]= space)%20 - Deleted messages are excluded from search by default
- 邮件ID是Apple Mail内部的ROWID(整数),显示在列中
id - 文件仅包含邮件头(正文未下载);
.partial.emlx会对此发出警告read - 附件会被复制到下的临时目录;使用完成后请清理
/tmp/ - 搜索查询的是
body表(Apple Mail的纯文本预览),而非完整邮件正文summaries - 邮箱URL是百分编码格式(例如 =
%5BGmail%5D,[Gmail]= 空格)%20 - 默认情况下,已删除邮件会被排除在搜索结果之外