Apple Mail Search Safe (fruitmail)技能使用说明
2026-03-28
新闻来源:网淘吧
围观:20
电脑广告
手机广告
Fruitmail (快速 & 安全)
基于 SQLite 的 Apple Mail.app 快速搜索,支持全文内容。
安装
npm install -g apple-mail-search-cli
用法
# Complex search
fruitmail search --subject "invoice" --days 30 --unread
# Search by sender
fruitmail sender "@amazon.com"
# List unread emails
fruitmail unread
# Read full email body (supports --json)
fruitmail body 94695
# Open in Mail.app
fruitmail open 94695
# Database stats
fruitmail stats
命令
| 命令 | 描述 |
|---|---|
搜索 | 带筛选器的复杂搜索 |
发件人 <查询> | 按发件人邮箱搜索 |
未读 | 列出未读邮件 |
正文 <id> | 读取完整邮件正文 (AppleScript) |
打开 <id> | 在 Mail.app 中打开邮件 |
统计 | 数据库统计信息 |
搜索选项
--subject <text> Search subject lines
--days <n> Last N days
--unread Only unread emails
--limit <n> Max results (default: 20)
--json Output as JSON
--copy Copy DB before query (safest mode)
示例
# Find bank statements from last month
fruitmail search --subject "statement" --days 30
# Get unread emails as JSON
fruitmail unread --json | jq '.[] | .subject'
# Find emails from Amazon
fruitmail sender "@amazon.com" --limit 50
性能
| 方法 | 处理 13 万封邮件的耗时 |
|---|---|
| AppleScript(完整迭代) | 8分钟以上 |
| SQLite(此工具) | 约50毫秒 |
技术细节
- 数据库:
~/Library/Mail/V{9,10,11}/MailData/Envelope Index - 查询方法:SQLite(只读) + AppleScript(正文内容)
- 安全性:只读模式防止修改;提供可选的
--copy模式
注意事项
- 仅限macOS— 查询Apple Mail.app的本地数据库
- 只读— 可搜索/读取但无法撰写/发送
- 发送邮件:请使用
himalaya技能(IMAP/SMTP)
来源
文章底部电脑广告
手机广告位-内容正文底部


微信扫一扫,打赏作者吧~