Search, read, and extract attachments from Apple Mail's local storage on macOS.
apple-mail.sh — a bash script that queries the Apple Mail SQLite envelope index and reads .emlx files from disk. Read-only — it never modifies mail data.
| --from | Sender address substring | | --to | Recipient address substring | | --subject | Subject substring | | --body | Body/summary text substring | | --mailbox | Mailbox URL substring (e.g. INBOX, Sent, Trash) | | --after | Received after date | | --before | Received before date | | --unread | Only unread messages | | --flagged | Only flagged messages |
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. Source: mitsuhiko/agent-stuff.