Loading...
Loading...
Search, read, and extract attachments from Apple Mail's local storage. Query emails by sender, recipient, subject, body, date, mailbox, and flags. Read raw RFC822 messages and extract file attachments.
npx skill4agent add mitsuhiko/agent-stuff apple-mailapple-mail.sh.emlxTOOL=~/Development/agent-stuff/skills/apple-mail/apple-mail.sh
# Search emails
$TOOL search --from "peter@" --subject "dinner" --limit 5
$TOOL search --after 2026-02-01 --has-attachment
$TOOL search --body "invoice" --mailbox "INBOX" --unread
$TOOL search --to "armin@" --before 2025-12-31
# Show message metadata, recipients, attachments, and summary
$TOOL info 783660
# Read the raw RFC822 email (headers + body)
$TOOL read 783660
# Extract attachments to a temp directory (prints the path)
$TOOL attachment 783660 # all attachments
$TOOL attachment 783660 "Rechnung.pdf" # specific file
# List all mailboxes with counts
$TOOL mailboxes| Flag | Description |
|---|---|
| Sender address substring |
| Recipient address substring |
| Subject substring |
| Body/summary text substring |
| Mailbox URL substring (e.g. |
| Received after date |
| Received before date |
| Only unread messages |
| Only flagged messages |
| Only messages with attachments |
| Max results (default: 20) |
searchid|sender|sender_name|subject|received|status|flagged|mailbox|attachmentsinforeadattachmentid.partial.emlxread/tmp/bodysummaries%5BGmail%5D[Gmail]%20