What is an EMLX file, and how it differs from EML
An EMLX is not a renamed EML. There is a byte count in front and a property list behind, and both matter if you are converting one.
An EMLX file is an ordinary email message with two Apple additions. A byte count sits on the first line. An XML property list sits after the message. Strip both and you have a standard EML file. Leave either in place and most applications will refuse it or read it wrongly.
Apple has never published a specification. Everything known about the format, including everything below, comes from people opening the files and working it out.
The three parts of an EMLX file
Any text editor shows the structure straight away.
875
Subject: very simple
From: Sender <sender@example.com>
Date: Fri, 29 Mar 2013 19:09:06 -0400
Content-Type: text/plain; charset=us-ascii
Foo
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>flags</key> <integer>261253</integer>
<key>subject</key> <string>very simple</string>
</dict>
</plist>
The middle section is the part with universal value. It is a normal RFC 822 message, headers and body, exactly as it would appear in an EML file. It carries no mbox style escaping at all.
EMLX compared to EML
EML
Read by nearly everything
- Starts with a header line
- Message and nothing else
- Ends where the message ends
- No record of read state or colour
EMLX
Read by Apple Mail
- Starts with a number
- Message wrapped front and back
- Ends with an XML property list
- Carries flags, colour and threading
Why Apple Mail uses EMLX
Mail did not always work like this. Each mailbox was a single mbox file until Mac OS X 10.4 Tiger and the change to one file per message arrived with it in 2005, alongside Spotlight.
Read more: How Mac email clients store mail on disk.
Nobody at Apple has said why. The timing is the basis for the usual explanation. An indexer can re-read one small file when a message changes. Doing the same against a mailbox file holding thousands of messages means parsing the lot every time. The format is awkward to convert because it was never built for conversion. It was built to be indexed.
Why renaming EMLX to EML does not work
The suggestion turns up constantly and it fails for a specific reason worth understanding.
An EML file has to begin with a header line. An EMLX begins with a number, so a parser reading the first line finds something that is not a header. It either stops or treats the whole file as malformed. The property list causes the same trouble from the other end, arriving where the message should have finished.
The byte count is a length, not a label. It states how many bytes the message occupies. Edit the message by hand and the number stops matching what follows. That is a quieter kind of broken than a file which refuses to open. Anything modifying an EMLX has to recalculate it.
What the EMLX property list holds
This is where Apple Mail keeps everything the message itself has no room for.
| Key | What it carries |
|---|---|
flags | Read, replied, forwarded and more, packed into one integer |
color | The colour flag you applied in the sidebar |
conversation-id | Which thread Apple Mail considers this part of |
date-sent and date-last-viewed | When it was sent. When you last opened it |
remote-id | The identifier the server knows it by |
original-mailbox | Where it arrived, including the account protocol |
None of that has anywhere to go in an EML file. A conversion produces a complete, correct message and quietly drops the read state, the colour and the threading. The destination format has no concept of any of them.
Worth knowing before a large migration rather than after. The mail arrives intact and looks wrong, because the information was never in the message to begin with.
Partial EMLX files and separated attachments
Alongside the ordinary files you will find some named partial.emlx. They are the reason a conversion can come out incomplete without anything appearing to go wrong.
A partial file holds the message without its attachments. Those sit beside it carrying the .emlxpart extension, one per attachment. Only a tool that goes looking will put the pieces back together. Convert the partial file alone and you get a message referring to attachments it does not contain.
How to convert EMLX to EML without software
The best route avoids the format question altogether.
Select the messages inside Apple Mail and drag them out to a folder in Finder. macOS writes each one as a standard EML file, headers and attachments intact. Nothing touches the EMLX files, so the byte count and the property list never become your problem. The same trick has limits once you are moving whole mailboxes rather than a selection. At that point an EML converter for Mac, which reads EMLX as well, does the parsing in one pass.
It works in reverse too. Drag EML files into an Apple Mail mailbox and the application stores them as EMLX for you. Contrary to a claim that circulates widely, Apple Mail reads EML perfectly well. Nobody needs to convert anything to get old messages into it.
Converting the files themselves
Where Mail will not open or the mailbox is long gone, the files are all you have. Three decisions matter more than which tool you pick.
- Convert the folder, not the file. A tool pointed at one message cannot find the attachments belonging to it. Give it the directory instead.
- Decide about the metadata first. If flags and threading matter, EML will not carry them. Keeping the originals as well, rather than instead, is the answer.
- Check what the destination actually needs. Discovery and forensic tools frequently accept EML and nothing else. Moving to Outlook means converting to PST or converting to MSG instead. A long term archive is better served by a format with no vendor behind it.
For a whole mailbox rather than a set of messages, exporting from Apple Mail produces MBOX and avoids the question. The export reads the store Apple Mail keeps under ~/Library/Mail rather than the files underneath it.
Common questions
Will changing the extension to .eml work?
No. The first line is a number that is not part of the message. There is XML after the message that is not part of it either. Both have to come off, which is a text operation rather than a rename.
What is a partial.emlx file?
A message whose attachments were never downloaded or were stored separately. The message is there and the attachments sit in their own files nearby, so a converter has to reunite them rather than read one file.
Can Thunderbird open EMLX files?
Not directly. It reads EML happily, so the practical route is converting first. Pointing an importer at a folder of EMLX files is the failure people report most.
Is EMLX documented by Apple?
No. Everything published about it has been worked out by inspection, including the structure described here. The Library of Congress maintains a format description built the same way.
Does converting EMLX to EML lose anything?
The message survives intact. What goes is the Apple metadata, so flags, colours and conversation grouping have nowhere to land in an EML file and are dropped.
Why are the files numbered rather than named?
Because the name is an identifier rather than a description. Apple Mail tracks messages by number and keeps the subject inside the file, which is why a folder of them tells you nothing until something reads them.
Sources
Every date, version number and path above is taken from these pages rather than from memory.