Rebuilding the Apple Mail Envelope Index

Some time ago, I had set up my Gmail account in Apple Mail in order to copy over messages that were missing in my online jimmitchell.org IMAP account. I’m one of those guys who likes to have everything all in one place at my finger tips when I want it.

After copying over the messages I wanted, I completely removed the Gmail IMAP account from Mail and went about my business. Soon after, when I went searching for a specific email, I experienced the phenomenon of ghost emails in the search results (see image below). These are messages that Mail once knew about, but no longer knows where they exist. The ghost emails were all from the since removed Gmail account.

mail_index.jpg

If you’re experiencing the same problem, here’s a very simple fix to rebuild the Apple Mail envelope index. First, quit Apple Mail if it’s running, then navigate your way to “~/Library/Mail/” (where “~” is your home folder) in the Finder. Once you’re in the Mail folder, you’ll see a file named “Envelope Index” which keeps track of where all messages are located. Rename “Envelope Index” to “Envelope Index Backup” (We don’t want to trash the file just yet).

Then, relaunch Apple Mail. You’ll be presented with a daunting “Message Import” dialog that looks like your email account was wiped out and you’re starting all over. Fear not. You’re simply rebuilding the Envelope Index at this point.

Apple Mail Envelope Index

Click “Continue” to rebuild the index. Once it’s done, all those pesky phantom messages will be gone the next time you perform a search in Mail (Yay!). You can then go back to the “~/Library/Mail/” folder in the Finder and move the file you renamed to “Envelope Index Backup” to the Trash.

And there you have it. Your Apple Mail Envelope index has been rebuilt. A very simple solution to a problem that has baffled some of the best Mac users.

  • graafisk

    I needed this. I did it. It worked perfectly.
    Thank you!!!! Good, clear & concise instructions.
    I’m a happy Mac again. :-D

  • Jason

    Worked for me too. Thanks a million!

  • grumpf

    Great. This worked just perfectly. Thx

  • Nicole

    thanks – worked perfectly!

  • Darren

    Failed miserably in 10.5.4 under Mail 3.4 on a test copy of my Mail folder on a Tester user account. It rebuilt the Envelope Index but with no information in it. All 7318 messages are unread, have no titles, and were received at the time of rebuild. Not to mention that there are no message contents to be seen when selecting one. All the .emlx files are there but none show any contents when opened directly (double click the file) into Mail.