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.
- In Mail, select the desired Mailbox from the left-hand panel.
- From the Mailbox menu, choose Rebuild.
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
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:
- Go to System Preferences.
- Open Spotlight and check the Privacy tab.
- If your Mail folder or subfolders appear in the list, just remove them with the little “-“ button.
- Allow some time for Spotlight to index that folder and then try to search your mail again.
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:
- Open Mail’s preferences and select the Accounts tab.
- Select the chosen email account from the left-hand side pane and then Advanced.
- In the top section, make sure that All messages and their attachments is selected in the offline viewing pop-up menu.
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.
- Open Terminal from the Applications -> Utilities folder or from Spotlight.
- Type in this command followed by return: sudo mdutil – E
- 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:
- Select the mailbox in Mail’s left-hand side panel.
- Right-click and choose Synchronize from the pop-up menu.
- When the process has completed (you can check progress in the Mail Activity area) try your search again.
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.