skills/apple-mail/mail-from/SKILL.md
Show all emails from a specific person, email address, or domain. Summarize the relationship and communication history. Use when user asks about emails from someone, or wants to see what a specific sender has sent them. Arguments: person name, email address, or domain (e.g. "[email protected]", "amazon.com", "my boss Sarah").
npx skillsauth add aashari/ai-agent-skills mail-fromInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Sender query: $ARGUMENTS
DB="$HOME/Library/Mail/V10/MailData/Envelope Index"
QUERY="$ARGUMENTS" # treat as search term against address + comment fields
sqlite3 "$DB" "
SELECT DISTINCT a.address, a.comment, COUNT(*) as cnt
FROM messages m
JOIN addresses a ON m.sender = a.ROWID
JOIN mailboxes mb ON m.mailbox = mb.ROWID
WHERE (a.address LIKE '%${QUERY}%' OR a.comment LIKE '%${QUERY}%')
AND m.deleted = 0
GROUP BY a.address
ORDER BY cnt DESC
LIMIT 10;" 2>/dev/null
If multiple matches, show options and ask which one (or proceed with all if they're clearly the same person/org).
sqlite3 "$DB" "
SELECT datetime(m.date_received,'unixepoch','localtime') as dt,
s.subject, mb.url as mailbox, m.ROWID, m.read, m.flagged
FROM messages m
JOIN subjects s ON m.subject = s.ROWID
JOIN addresses a ON m.sender = a.ROWID
JOIN mailboxes mb ON m.mailbox = mb.ROWID
WHERE a.address LIKE '%SENDER%'
AND m.deleted = 0
AND mb.url NOT LIKE '%Spam%'
AND mb.url NOT LIKE '%Trash%'
ORDER BY m.date_received DESC
LIMIT 100;" 2>/dev/null
sqlite3 "$DB" "
SELECT
COUNT(*) as total,
SUM(CASE WHEN m.read = 0 THEN 1 ELSE 0 END) as unread,
SUM(CASE WHEN m.flagged = 1 THEN 1 ELSE 0 END) as flagged,
MIN(datetime(m.date_received,'unixepoch','localtime')) as first_email,
MAX(datetime(m.date_received,'unixepoch','localtime')) as latest_email,
strftime('%Y-%m', datetime(m.date_received,'unixepoch','localtime')) as busiest_month
FROM messages m
JOIN addresses a ON m.sender = a.ROWID
JOIN mailboxes mb ON m.mailbox = mb.ROWID
WHERE a.address LIKE '%SENDER%' AND m.deleted = 0
GROUP BY busiest_month
ORDER BY COUNT(*) DESC LIMIT 1;" 2>/dev/null
python3 ~/.claude/skills/_mail-shared/parser.py <ROWID1> <ROWID2> ...
Lead with relationship summary:
Then list recent emails (last 10-20) as a table. Group older emails by month if there are many. Highlight unread and flagged ones. Offer to read any specific email or summarize the thread.
data-ai
Show work emails only, filtered to Exchange/EWS accounts and corporate email domains. Digest with priorities. Use when user asks about work email, work inbox, or wants to separate work from personal mail. Arguments: optional date range or "today", "yesterday", "this week".
testing
Intelligent inbox triage — surface the most important emails across all accounts, prioritized by urgency and requiring attention. Use when user wants a smart overview of what needs their attention, asks "what's important in my email", or wants help deciding what to read first. Arguments: optional time window (default: last 48 hours) or account filter.
data-ai
Find flight bookings, hotel reservations, travel itineraries, and booking confirmations from email. Use when user asks about upcoming trips, travel plans, booking references, flight details, or hotel reservations. Arguments: optional destination, airline, date range, or booking service.
testing
Show who sends the most email, communication frequency analysis, and relationship mapping. Use when user asks who emails them most, top contacts, communication patterns, or wants to understand their email social graph. Arguments: optional time range (default: last 90 days), account filter, or "humans only" to exclude automated senders.