One of the nicest features on a Mac is how intelligently it can help you search your email. You can do your search in Mail.app or from Spotlight. Sometimes, though, you’ll experience problems. Here’s how you can fix broken Mail search on macOS Catalina and Big Sur.
Restart Spotlight Indexing
Your first step in fixing broken Mail search should be to stop, clear, and restart your Spotlight indexing. The other method that usually works will reset all your defaults in Mail.app. To avoid this, try following Apple’s support article on rebuilding the Spotlight index. Or, follow these steps
Quit Mail.app, then open Terminal.app. To stop and flush the indexes, enter the command sudo mdutil -i off -E
.
Now, let’s verify indexing is stopped:
sudo mdutil -s
We’ll restart Spotlight indexing like this:
sudo mdutil -i on
To verify indexing is turned on again, just do sudo mdutil -s
a second time.
Next, you need to clear the Mail.app indexes in ~/Library/Mail/V7/MailData
for macOS Catalina. On macOS Big Sur, it will be ~/Library/Mail/V8/MailData
. From Finder > Go to folder, enter ~Library/Mail/V7/MailData
or ~/Library/Mail/V8/MailData
. You’ll see some Envelope Index files; drag them to the Trash, then empty the Trash. Don’t worry, they’ll be rebuilt.
Now, restart your Mac and then reopen Mail.app. Hopefully, this will have solved your issue with searching Mail.
Fixing Seriously Broken Email Searches
This next method is a bit more destructive to how you have Mail.app set up, but it might be your only hope if reindexing Spotlight didn’t do the trick. Nevertheless, when you’re dealing with broken email search, this could be your last resort. What you’re going to do is completely reset Mail.app to its defaults.
Go ahead and close Mail.app completely. Now, hold the Shift key (either one will do) and click on Mail. Once it’s fully launched, close Mail.app completely again.
Once again, hold Shift and click on Mail.app. Close Mail.app completely one final time. Now, restart your Mac.
Enjoying Your Mac’s Email Again
After your Mac boots back up and you get logged in, open Mail.app. Everything should start working fine again. Bookmark this article, just in case the problem rears its ugly head again.
I have tried the initial steps (the sudo mdutil ones) and get no response – even when I use the “show” switch. I would have expected a response of some sort. Any suggestions?
Hello John and sorry for the late response. We recommend that you rebuild the Spotlight index on your Mac. Here’s how to do it: https://support.apple.com/en-us/HT201716
I had tried many different “solutions” to my problems with Mail, but as soon as I read this article, I knew I had found the right advice. After following the Terminal steps, plus the Envelope Index file removal steps, Mail started an almost two hour process of repairing itself. Solved all of my issues with Mail. Thanks for such thorough information.
That’s so awesome! Thanks for letting us know it helped. This is why I write these up!
The terminal instructions also just solved this [highly frustrating!] issue for me–thank you for sharing your expertise!!
Wow this article is a tour de force. Freak’n great job Jeff!
Thanks, John! I can always count on you to enjoy my geekier posts 😀
How is that different from these:
Apple Mail – Mailbox – Rebuild.
BTW, is there a way to rebuild all Apple Mail mailboxes at once?
Thanks!
Sorry for the delay in responding. Doing the task through Spotlight preferences doesn’t work in many instances. I’m not sure what tasks that method fails to carry out…perhaps it’s a more non-destructive means, and doesn’t actually destroy the old indexes altogether and then let them be rebuilt.
The simple truth is that with macOS, as with any *nix-based operating system, GUI tools are sometimes no replacement for down-and-dirty command-line work.
As for rebuilding all Mail mailboxes at once, I’m not sure. I think the method above will do that, but I’ll dig around and see if there’s another way.
Thanks. In my case I must rebuild mailboxes on a one-by-one basis, or it does not work. Likewise when applying rules to move messages between mailboxes (and I must do it manually, since its automatic timing does not work).
I second that! I have tried both methods described in the article, and it did not help for all my six mail accounts. I was looking for a particular email – I knew the exact date I received that email, and I knew the account. Only Macsee’s suggestion (Apple Mail – Mailbox – Rebuild) did the trick. This problem occured on my new M1 MacBook Pro, that I had set up as a new device. For a good reason, I did not import user data from my old laptop. I set up the email accounts in Apple Mail, and since they are all IMAP accounts, I did not expect any losses. Thanks a lot to both of you!