apple-mail-searchFast 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.
Install via ClawdBot CLI:
clawdbot install mneves75/apple-mail-searchRequires:
Search Apple Mail.app emails instantly via SQLite. ~50ms vs 8+ minutes with AppleScript.
# Copy mail-search to your PATH
cp mail-search /usr/local/bin/
chmod +x /usr/local/bin/mail-search
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
-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
# 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
| 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.
Database: ~/Library/Mail/V{9,10,11}/MailData/Envelope Index
Key tables:
messages - Email metadata (dates, flags, FKs)subjects - Subject linesaddresses - Email addresses and display namesrecipients - TO/CC mappingsattachments - Attachment filenamesLimitations:
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;
"
MIT
Generated Mar 1, 2026
Freelancers can quickly search for invoice-related emails from clients using subject or sender filters, enabling fast retrieval of payment confirmations or outstanding invoices. This helps streamline financial tracking and reduces time spent manually scrolling through Mail.app.
Compliance teams in regulated industries like finance or healthcare can use the tool to search for emails with specific attachments (e.g., PDF reports) or from certain senders within date ranges. This supports audit trails and ensures quick access to required documentation without relying on slow native searches.
Support agents can search unread emails or emails from specific customers to prioritize responses, using JSON output for integration with ticketing systems. This accelerates response times and improves customer service efficiency by bypassing Mail.app's sluggish search.
Researchers can export email data as CSV or JSON for analysis, such as gathering correspondence with collaborators or tracking submission deadlines via date-range searches. This facilitates data processing for studies on communication patterns or project management.
Marketing teams can search for emails related to campaigns by subject or sender to assess engagement, using the tool's fast queries to compile metrics from large email volumes. This aids in evaluating campaign performance and planning follow-ups efficiently.
Offer a basic version for free with core search features, then charge for advanced functionalities like batch exports, API access, or priority support. Revenue can come from subscription tiers targeting power users or small businesses needing enhanced productivity.
Sell site licenses to corporations for team-wide use, with added features like centralized database access, security audits, and integration with existing IT systems. Revenue is generated through one-time purchases or annual contracts based on user counts.
Provide services to customize the tool for specific industries, such as adding compliance filters or integrating with proprietary software, alongside training and support. Revenue comes from project-based fees and ongoing maintenance contracts.
💬 Integration Tip
Integrate with automation tools like cron jobs for scheduled email backups or use JSON output to feed data into dashboards for real-time monitoring.
Summarize URLs or files with the summarize CLI (web, PDFs, images, audio, YouTube).
AI-optimized web search via Tavily API. Returns concise, relevant results for AI agents.
This skill should be used when users need to search the web for information, find current content, look up news articles, search for images, or find videos. It uses DuckDuckGo's search API to return results in clean, formatted output (text, markdown, or JSON). Use for research, fact-checking, finding recent information, or gathering web resources.
Web search and content extraction via Brave Search API. Use for searching documentation, facts, or any web content. Lightweight, no browser required.
Search indexed Discord community discussions via Answer Overflow. Find solutions to coding problems, library issues, and community Q&A that only exist in Discord conversations.
Multi search engine integration with 17 engines (8 CN + 9 Global). Supports advanced search operators, time filters, site search, privacy engines, and WolframAlpha knowledge queries. No API keys required.