OS X

Find Missing Emails in Mac OS X’s Mail App

When you’re searching for email in the Mac’s Mail application and can’t find it, there could be several possible causes.

Mail includes a very convenient built-in search facility to find messages based on the headers, recipients and content, but occasionally you might find that it’s not coming up with the results you expect.

Once you’ve ruled out simple issues such as you might be searching in the wrong mailbox, follow the steps below to find the missing emails.



Rebuild Your Mailbox in Mail

Mail can completely rebuild your mailbox, which can fix many of the most common problems with missing email.

This solution can take quite some time because all messages will be deleted from your Mac. Therefore, it’s wise to try the other methods first if your mailbox is particularly large.

To rebuild a mailbox, proceed as follows.

  1. In Mail, select the desired Mailbox from the left-hand panel.
  2. From the Mailbox menu, choose Rebuild.
Rebuild Mail menu
Rebuild your email account

The selected mailbox will be rebuilt and messages from the server re-downloaded. In most cases, this is likely to fix any issues that you may be encountering.


Problems With Message Headers

There are a few more solutions to fix possible Mail issues. It depends whether you’re having problems with headers (such as the To, From, Subject, and CC fields) or the message content (i.e. the message body), because Mail uses two different systems to search each item.

Mail uses several indexes known as the Envelope Index to search message headers, so such problems can normally be resolved by forcing Mail to completely rebuild the Envelope index, as follows:

Quit Mail.

In Finder go to the folder ~/Library/Mail/V2/MailData and delete the following files:

  • Envelope-Index
  • Envelope-Index-shm
  • Envelope-Index-wal
Delete Envelope Index picture
Delete the Envelope Index files in the Mail folder

Now restart Mailand you’ll see a message informing you that it has to import your messages. Mail is actually rebuilding the index, which should in most circumstances fix the issue.


Problems With Message Content

As already mentioned, message content is indexed and searched completely independently from headers. Mac OS X actually uses Spotlight to search for message content, so the most likely cause is an issue with the Spotlight index itself.

Follow each of the steps below until your issue is resolved.

Check Spotlight Privacy

If you’ve accidentally blocked Spotlight from indexing your ~Library/Mail folder, this could be the cause of the problem.

Check Spotlight’s permissions as follows:

  1. Go to System Preferences.
  2. Open Spotlight and check the Privacy tab.
  3. If your Mail folder or subfolders appear in the list, just remove them with the little “-“ button.
  4. Allow some time for Spotlight to index that folder and then try to search your mail again.
Spotlight Privacy settings
Check the Spotlight Privacy settings to see if the Mail folders are present

Check Mail Settings

For server-based accounts (such as iCloud and IMAP mailboxes), it’s important that all your messages and attachments are downloaded from your mail server so that Spotlight can index them.

To check this:

  1. Open Mail’s preferences and select the Accounts tab.
  2. Select the chosen email account from the left-hand side pane and then Advanced.
  3. In the top section, make sure that All messages and their attachments is selected in the offline viewing pop-up menu.
Download attachments pop-up menu
Make sure that messages and attachments are set to download for offline viewing

Re-index Mail

It’s possible to completely re-index mail forcibly as follows.

Open Terminal from the Applications -> Utilities folder.
Type this command followed by return: mdimport -r /System/Library/Spotlight/Mail.mdimporter

This will force Spotlight to re-index all your emails, but other indexes will be left untouched.

Reset The Entire Spotlight Index

If none of the above methods seem to work, you could reset the entire Spotlight index but it will probably take a long time – up to several hours depending on how much data you have on the disk.

  1. Open Terminal from the Applications -> Utilities folder or from Spotlight.
  2. Type in this command followed by return: sudo mdutil – E
  3. When prompted, enter your system password (because only admin users are allowed to use this command).

Resynchronise Your Accounts

It’s also possible to resynchronise your email accounts. This process is very simple but can also take some quite some time:

  1. Select the mailbox in Mail’s left-hand side panel.
  2. Right-click and choose Synchronize from the pop-up menu.
  3. When the process has completed (you can check progress in the Mail Activity area) try your search again.
Synchronise mail accounts
Synchronise your email accounts

Before you go

After spending over 20 years working with Macs, both old and new, theres a tool I think would be useful to every Mac owner who is experiencing performance issues.

CleanMyMac is highest rated all-round cleaning app for the Mac, it can quickly diagnose and solve a whole plethora of common (but sometimes tedious to fix) issues at the click of a button. It also just happens to resolve many of the issues covered in the speed up section of this site, so Download CleanMyMac to get your Mac back up to speed today.

mac-pc

Tags

About the author

Roland Banks

I've been passionate about Apple ever since I bought my first iPod followed by a white polycarbonate MacBook in 2007. I currently own a MacBook Pro Retina, an iPad Mini Retina, and an iPhone 6.

6 Comments

Click here to post a comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Mountain Lion update:
    instead of finding index files in ~/Library/Mail/V2/MailData, it is now in:
    ~/Library/Containers/com.apple.mail/Data/Library/Mail/V2/MailData

  • Thanks! Deleting the “Envelope-Index*” files as describe in chapter “Problems With Message Headers” solved my issue eventually. I had a fresh install of OS X 10.9.5 Mavericks, had moved my ~/Mail/ folder to the fresh installation and have had imported my emails from Snow Leopard OS X 10.6.8. All emails were there. But a search only returned very recent emails matching the query, whereas for the very same query in Spotlight showed matches which spanned over the entire history. Second issue was, that almost all my marked emails were gone (from previously 150 to only 1 remained). The method fixed both the limited search scope and the lost marks. Thanks!

  • Hi! The “remove envelope files” incantation also worked for me, in a slightly different scenario. I had a disk crash on my old Mini (running Mavericks, thankfully with TimeMachine doing its job as faithfully as always), so I bought a new one, preinstalled with Yosemite. Recovering from TimeMachine looked great, except that although the folder structure in Mail (“On my Mac”) was intact, all folders showed 0 messages in them. This was truly strange, as all mbox files were in place and were very large (about 3GB in total; I never throw anything away…). Rebuild did nothing. Then I stumbled on your tip above, and noted that you said that this would force a re-import. I then realized that I had never gotten the “sorry, I have to re-import” message that I had expected (had gotten that when I had upgraded another Mini from Mavericks to Yosemite), so apparently this particular corner case (Mail thinking that it doesn’t need to re-import as it got all data from TimeMachine, so it should be OK). But your suggestion did trigger the re-import, and everything is now exactly as it should be.
    Huge thanks, I was a bit worried there for a while!
    Ulf O, Mac user since 1985

  • You are a saviour! Apple’s so-called fixes haven’t worked to restore the contents of my mailboxes when I upgraded to Yosemite. BUT YOUR FIX DID! I’d buy you a drink if you lived locally.

  • I updated this weekend to Apple’s new software on my iMac and my files in Mail which I created to store specific emails, has dissapeared. They’re “intelligent files” that show up when i use Mail via iCloud but not in the Mail application itself. any ideas?

  • i can’t do any of this if Mail won’t open in the first place after i followed instructions to move Envelope Index to the Desktop and now it’s disappeared completely after not importing.