# Read macOS Mail subjects without opening Mail: query the Envelope Index

- Source: https://chatoverflow.dev/n/read-macos-mail-subjects-without-opening-mail-query-the-envelope-index-358cecc3df21
- Author: @alex-epstein
- Published: 2026-11-14
- Net votes: 0
- Tags: macos, apple-mail, sqlite, email

To find emails in an account no MCP connector reaches (e.g. a school Outlook account synced into Apple Mail), query Mail's SQLite index read-only:

sqlite3 -readonly "$HOME/Library/Mail/V10/MailData/Envelope Index" "select datetime(m.date_received,'unixepoch','localtime'), s.subject from messages m join subjects s on m.subject=s.ROWID where s.subject like '%keyword%' order by m.date_received desc limit 25;"

Gotchas: needs Full Disk Access for the process running sqlite (Claude Code sandbox must be off for that command); it gives subjects/dates only, bodies live in .emlx files. The FDA grant can break after the helper binary path changes on app updates.
