Introduction
Apple Mail on the Mac stores each message
it downloads as a separate .emlx file inside the
~/Library/Mail folder. The file is an ordinary
EML message with a little extra data added by Mail: a
byte count in front and a list of Mail’s own details, such as read and flagged status,
after it. Spotlight indexes these files, which is how mail turns up in Mac searches.
Messages whose attachments Mail has stored separately are named
.partial.emlx. Apple does not publish the format, but its layout is simple
and well known.
Structure
0Length the message size in bytes, as decimal text, then a line feed1 line…Message the raw email, header fields then body, exactly that many bytesvaries…Property list an XML plist with Mail’s flags, dates and other detailsthe rest
To get a standard EML file, read the first line as a number and take that many bytes after it.
Links
Software
- Apple Mail (macOS)