10

When I search for a particular message in Mail.app, using the search field, even when I have the message in sight, Mail cannot find it. But, frustratingly, when I use Spotlight, it is able to find the message.

For example, I'll open a folder with a variety of recipes. I can see all the subjects and I see an email with the subject: "Smoothies". Typing in "Smoothies" into the search field brings up 0 results. But typing in "Smoothies" into Spotlight shows the desired message.

How can I get Mail.app to search correctly?

I'm running Mac OS X 10.11.3.

13

Rebuilding Mail.app's mailboxes fixed this for me. This ComputerWorld article is a great reference for rebuilding and reindexing your mailboxes:

  • Rebuild: Select a mailbox (or several by shift-clicking) and then use "Mailbox > Rebuild"
  • Reindex: Quit Mail, navigate to ~/Library/Mail/V2/MailData (on Mac OS 10.12 - Sierra, ~/Library/Mail/V4/MailData) and delete any files where the name begins with Envelope Index. Mail will rebuild the indexes on the next start (which may take a long time depending on the size of your mailboxes)
  • 1
    When I delete the Envelope files (three of them) from the V3/MailData directory on Mac OS 10.11, I get a message on next opening about migrating mail from the previous version of Mail, which isn't what the article said. So I put them back. But search still isn't working at all. – Wildcard Jun 13 '17 at 6:44
  • Problem occurred out of the blue without my changing anything (that I am aware of). Rebuilding did not help, but reindexing sure did! Thanks! – bsumirak Aug 3 '17 at 13:59
  • Rebuilding was unsuccessful, but the Reindex worked. To @Wildcard's point, yes, I got the same warning about migrating. I went ahead and selected continue and Mail recreated the Envelope* files. – KenB Sep 10 '18 at 15:35
  • I tried reindexing but still searching doesn't work. – Kouichi C. Nakamura Aug 16 at 7:42
5

for years I had this problem (on and off) and tried everything I could find. Finally I found this: for some reason indexing was turned off and I had to 'switch it on' with sudo mdutil -a -i on After that mail search immediately worked. Hope this will make a few people less frustrated with mail (like I was)

  • For years I had this problem on one of my several devices and this was the solution!! Thank you!! – Todd Aug 1 '17 at 1:25
  • This was the only solution that worked for me on High Sierra Version 10.13.6. Thanks! – Ling Toh May 13 at 16:54
4

This helped me - it allows unrestricted spotlight search - and, after executing that command, mail search and smart mailboxes worked again

Open terminal from the utilities folder and execute:

sudo defaults write /Library/Preferences/com.apple.security.appsandbox \
    UnrestrictSpotlightContainerScope -bool true
  • This has also worked for me every time I have this problem. – Simone Manganelli Jun 1 '17 at 20:55
  • 1
    Well - this seems to help also in my case. But - this doesn't look like a solution but rather like a workaround to a deeper problem. It seems like we are relaxing some security related restrictions, which we shouldn't have to do in the very first place. But yes, it works for me too (after restarting Mail.app), – silverdr Aug 6 '18 at 9:31

You must log in to answer this question.

protected by Community Aug 10 '17 at 14:49

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged .