← 返回 Skills 市场
mneves75

Apple Mail Search

作者 mneves75 · GitHub ↗ · v1.0.0
darwin ⚠ suspicious
3254
总下载
2
收藏
12
当前安装
1
版本数
在 OpenClaw 中安装
/install apple-mail-search
功能描述
Fast Apple Mail search via SQLite on macOS. Search emails by subject, sender, date, attachments - results in ~50ms vs 8+ minutes with AppleScript. Use when asked to find, search, or list emails.
使用说明 (SKILL.md)

Apple Mail Search

Search Apple Mail.app emails instantly via SQLite. ~50ms vs 8+ minutes with AppleScript.

Installation

# Copy mail-search to your PATH
cp mail-search /usr/local/bin/
chmod +x /usr/local/bin/mail-search

Usage

mail-search subject "invoice"           # Search subjects
mail-search sender "@amazon.com"        # Search by sender email
mail-search from-name "John"            # Search by sender name
mail-search to "[email protected]"  # Search sent mail
mail-search unread                      # List unread emails
mail-search attachments                 # List emails with attachments
mail-search attachment-type pdf         # Find PDFs
mail-search recent 7                    # Last 7 days
mail-search date-range 2025-01-01 2025-01-31
mail-search open 12345                  # Open email by ID
mail-search stats                       # Database statistics

Options

-n, --limit N    Max results (default: 20)
-j, --json       Output as JSON
-c, --csv        Output as CSV
-q, --quiet      No headers
--db PATH        Override database path

Examples

# Find bank statements from last month
mail-search subject "statement" -n 50

# Get unread emails as JSON for processing
mail-search unread --json | jq '.[] | .subject'

# Find all PDFs from a specific sender
mail-search sender "@bankofamerica.com" -n 100 | grep -i statement

# Export recent emails to CSV
mail-search recent 30 --csv > recent_emails.csv

Why This Exists

Method Time for 130k emails
AppleScript iteration 8+ minutes
Spotlight/mdfind Broken since Big Sur
SQLite (this tool) ~50ms

Apple removed the emlx Spotlight importer in macOS Big Sur. This tool queries the Envelope Index SQLite database directly.

Technical Details

Database: ~/Library/Mail/V{9,10,11}/MailData/Envelope Index

Key tables:

  • messages - Email metadata (dates, flags, FKs)
  • subjects - Subject lines
  • addresses - Email addresses and display names
  • recipients - TO/CC mappings
  • attachments - Attachment filenames

Limitations:

  • Read-only (cannot compose/send)
  • Metadata only (bodies in .emlx files)
  • Mail.app only (not Outlook, etc.)

Advanced: Raw SQL

For custom queries, use sqlite3 directly:

sqlite3 -header -column ~/Library/Mail/V10/MailData/Envelope\ Index "
SELECT m.ROWID, s.subject, a.address
FROM messages m
JOIN subjects s ON m.subject = s.ROWID
LEFT JOIN addresses a ON m.sender = a.ROWID
WHERE s.subject LIKE '%your query%'
ORDER BY m.date_sent DESC
LIMIT 20;
"

License

MIT

安全使用建议
This skill appears to do what it says (query Mail's Envelope Index with sqlite), but there are important inconsistencies to resolve before installing or running anything: 1) The SKILL.md expects a 'mail-search' executable to be copied into /usr/local/bin, yet the skill package contains no binary—verify where that binary is supposed to come from (the GitHub homepage may host it). 2) The SKILL.md metadata requires sqlite3 but the registry metadata reported none—ensure sqlite3 is the only external dependency. Before installing: inspect the upstream GitHub repository and its source code, prefer building the tool from source rather than downloading unsigned releases, verify the binary's integrity (checksums/signatures), and review the code to ensure it only reads the Mail Envelope Index and does not transmit data externally. Avoid running cp/chmod from untrusted instructions; instead fetch/install the tool manually in a controlled environment. If you must grant the tool access to Mail data, consider running it on a disposable account or VM and back up Mail data first. If you want more assurance, provide the repository link and I can point out exact files/lines to review (or confirm whether a bundled binary should have been included).
功能分析
Type: OpenClaw Skill Name: apple-mail-search Version: 1.0.0 The skill bundle describes a tool for searching Apple Mail's local SQLite database on macOS. The `SKILL.md` provides clear instructions for installation and usage, which involve copying a local `mail-search` binary to `/usr/local/bin` and using the standard `sqlite3` utility. There is no evidence of data exfiltration to external endpoints, malicious execution beyond the stated purpose, persistence mechanisms, obfuscation, or prompt injection attempts against the agent to perform unauthorized actions. All described operations are local and aligned with the stated goal of searching mail metadata.
能力评估
Purpose & Capability
Name/description, technical details, and example commands all align with a tool that queries Mail's Envelope Index via sqlite. However the SKILL.md metadata declares sqlite3 as a required binary while the registry metadata showed no required binaries—an inconsistency. Also the instructions assume a 'mail-search' executable is available to copy to /usr/local/bin, but this skill bundle contains no code files or binary.
Instruction Scope
Instructions are narrowly scoped to reading Mail.app's Envelope Index (~/Library/Mail/.../MailData/Envelope Index) and using sqlite3; that is coherent with the purpose. The concerning part is explicit install guidance to copy an external 'mail-search' binary into /usr/local/bin despite no binary being packaged. The doc does not instruct any unrelated data collection or external network exfiltration, but the install step gives an agent the ability to place a binary on the system if the agent follows it.
Install Mechanism
There is no formal install spec in the registry (instruction-only), which is low-risk. But SKILL.md requires an external binary to be copied into /usr/local/bin — since the binary is not included, the user/agent would need to obtain it (e.g., from the listed GitHub homepage). Downloading and installing an unsigned binary from an external source is higher risk; the skill does not provide an official, auditable install mechanism in-package.
Credentials
The skill requests no environment variables, no credentials, and no config paths beyond the Mail Envelope Index path (which the tool legitimately needs to read). There are no unexplained secret requests.
Persistence & Privilege
Skill flags show no always:true or other elevated persistence. The only persistence-like action in the instructions is copying a CLI binary to /usr/local/bin (normal for CLI tools) which requires write privileges but is not intrinsic to the skill bundle itself.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install apple-mail-search
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /apple-mail-search 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of Apple Mail Search: fast email searching for Apple Mail via direct SQLite queries. - Enables subject, sender, date, unread, attachments, and advanced searches with typical results in ~50ms. - Includes command-line options for JSON/CSV output and database selection. - Provides examples for common email queries and export tasks. - Designed as a significantly faster alternative to AppleScript and Spotlight, which is broken since Big Sur.
元数据
Slug apple-mail-search
版本 1.0.0
许可证
累计安装 12
当前安装数 12
历史版本数 1
常见问题

Apple Mail Search 是什么?

Fast Apple Mail search via SQLite on macOS. Search emails by subject, sender, date, attachments - results in ~50ms vs 8+ minutes with AppleScript. Use when asked to find, search, or list emails. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 3254 次。

如何安装 Apple Mail Search?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install apple-mail-search」即可一键安装,无需额外配置。

Apple Mail Search 是免费的吗?

是的,Apple Mail Search 完全免费(开源免费),可自由下载、安装和使用。

Apple Mail Search 支持哪些平台?

Apple Mail Search 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(darwin)。

谁开发了 Apple Mail Search?

由 mneves75(@mneves75)开发并维护,当前版本 v1.0.0。

💬 留言讨论