I am trying to recover my Apple Mail inbox on macOS Yosemite (Mail v8) after a series of events caused all messages to disappear from the application, even though the raw files are still present on disk.
What happened
-
The Inbox was accidentally deleted on an iPhone, which removed the IMAP messages from the server.
-
On my MacBook (offline at that moment), the emails were still present locally inside Apple Mail.
-
I tried to move the messages from the IMAP Inbox into a local “On My Mac” mailbox to save them.
-
During this move, the Mac ran out of disk space.
-
The move operation aborted, and afterwards the original Inbox inside Apple Mail appeared completely empty.
-
However, on the filesystem, the raw (emlx and Attachments) mail files still exist.
Where the files are located
The messages are stored in Apple Mail’s IMAP local cache at:
~/Library/Mail/V2//INBOX.mbox/
with a structure like:
INBOX.mbox/
└── /
└── Data/
└── 0/
└── 1/
├── Messages/
└── Attachments/
└── 2/
└── 3/
... (many more)
Inside these various Messages folders there are thousands of:
*.emlx
*.emlxpart
*.partial.emlx
What I am seeing
-
Each .emlx file has a normal file size (for example several KB or more).
-
But when I open them directly on macOS, they appear empty in Apple Mail and show no message text.
-
If I manually rename an .emlx file to .eml and open it on Windows or in another mail program, the message content is fully visible.
-
So the file content is still there, Apple Mail just refuses to display it.
Current state
-
I now have plenty of free disk space again.
-
I still have the entire original INBOX.mbox folder.
-
Apple Mail refuses to show or rebuild the messages.
-
Rebuilding the Mail index (Envelope Index* files) did not help.
-
The data clearly exists in the .emlx, but Apple Mail does not see it.
My question
How can I restore the mailbox so that Apple Mail recognizes and displays the messages again?
I would like to either:
-
rebuild the original IMAP Inbox locally in Apple Mail,
-
or recreate a valid local mailbox from the .emlx files,
-
or convert this structure into a proper .mbox file Apple Mail can import.
At this point I simply want a clean mailbox (local or mbox export) so I can later upload the messages to the IMAP server again.
Additional notes
macOS: Yosemite
Mail.app version: 8
IMAP account
No Time Machine backup
Issue started after the disk ran out of space during a move from IMAP to local mailbox
The raw files still contain the real message data (verified by renaming to .eml)