openclaw 网盘下载
OpenClaw

技能详情(站内镜像,无评论)

首页 > 技能库 > 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.

通信与消息

许可证:MIT-0

MIT-0 ·免费使用、修改和重新分发。无需归因。

版本:v1.0.0

统计:⭐ 2 · 2.9k · 10 current installs · 10 all-time installs

2

安装量(当前) 10

🛡 VirusTotal :良性 · OpenClaw :可疑

Package:apple-mail-search

安全扫描(ClawHub)

  • VirusTotal :良性
  • OpenClaw :可疑

OpenClaw 评估

The skill's stated purpose (fast Apple Mail search via the Envelope Index) matches its instructions, but the SKILL.md expects an external 'mail-search' binary (not bundled) and the registry metadata and SKILL.md disagree about required binaries—these inconsistencies warrant caution.

目的

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.

说明范围

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 abil…

安装机制

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.

证书

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.

持久

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.

安装(复制给龙虾 AI)

将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。

请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「Apple Mail Search」。简介:Fast Apple Mail search via SQLite on macOS. Search emails by subject, sender, d…。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/mneves75/apple-mail-search/SKILL.md
(来源:yingzhi8.cn 技能库)

SKILL.md

打开原始 SKILL.md(GitHub raw)

---
name: apple-mail-search
description: 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.
homepage: https://github.com/steipete/clawdbot
metadata: {"clawdbot":{"emoji":"📬","os":["darwin"],"requires":{"bins":["sqlite3"]}}}
---

# Apple Mail Search

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

## Installation

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

## Usage

```bash
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 "recipient@example.com"  # 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

```bash
# 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:

```bash
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