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:
In Finder go to the folder ~/Library/Mail/V2/MailData and delete the following files:
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.
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.