Inside Apple Mail's SQLite Database: How Envelope Index Stores Your Email Metadata
Apple Mail stores all mailbox metadata in a SQLite database called Envelope Index, located at ~/Library/Mail/V10/MailData/. The database uses a normalized schema with key tables including messages, subjects, addresses, recipients, mailboxes, and attachments, each designed to minimize redundancy by storing repeated strings like subjects and addresses only once. Message bodies are not held in the database but stored as individual .emlx files named by row ID alongside it. A developer built an open-source MCP server on top of this database, reporting that a subject search across 300,000 messages dropped from 10 seconds to near-instant using the indexed metadata. Accessing the database requires Full Disk Access permissions, and Apple recommends opening it in read-only mode to avoid conflicts with Mail's WAL journaling.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in