Fast SQLite-based search for Apple Mail.app with full body content support.
- ⚡ Fast: Direct read-only SQLite access (zero-copy default)
- 🔒 Safe: Uses read-only mode by default, or copies DB with
--copyflag - 📧 Body content: Read full email bodies via AppleScript (fast for a few emails)
- 🔍 Full search: Search by subject, sender, recipient, date range, attachments, and more
Using npm (Recommended):
npm install -g apple-mail-search-cliUsing Bash (Zero dependency):
curl -sSL https://raw.githubusercontent.com/gumadeiras/fruitmail-cli/master/fruitmail | bash# 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| Method | Time for 130k emails |
|---|---|
| AppleScript (full iteration) | 8+ minutes |
| SQLite (this tool) | ~50ms |
- Database:
~/Library/Mail/V{9,10,11}/MailData/Envelope Index - Query method: SQLite (read-only) + AppleScript (body content)
- Safety: Read-only mode prevents modification; optional
--copymode available
Available as a skill on ClawHub for OpenClaw users. Install with:
clawdhub install fruitmail-safeMIT