MacOS Mail App Stuck Indexing

It is that beautiful time of year where once again MacOS has decided to forget how to search my Mail.app inboxes. There are plenty of reports online about this issue occuring over the last few years and it appears there is no obvious solution - or fix from Apple.

What occurs is when you attempt a search in Mail.app's interface, no results are returned and the status area shows as permanently stuck at indexing.

Searching shows a number of "remedies" that don't actually work. These include the:

  • Add Macintosh HD to spotlight privacy, wait 10 seconds, then remove it.
  • Uncheck and recheck "mail" in spotlight options.
  • Checking for login items that "might interfere".
  • Delete and recreate envelope index files
  • Rebuilding mailboxes
  • Healing crystals or something.

⚠️ NONE OF THESE SUGGESTIONS WORK. NONE. DON'T WASTE YOUR TIME. ⚠️

Anyway, the fix is far simpler but requires some confidence to use a terminal. All of these commands must be run as root (aka, prefixed with sudo).

Disable all spotlight indexes on all volumes.

mdutil -ia off

Erase all indexes

mdutil -Ea

Reboot your machine. I'm serious, you can't skip this step, you have to reboot here.

When the machine comes back, wait a few minutes for things to "settle".

Now remove the spotlight index directories completely.

mdutil -Xa

Finally, re-enable the indexing process

mdutil -ia on

You can check the status of the reindex with:

mdutil -sav

Or by opening spotlight search and typeing one letter, which will then show a progress bar of the indexing process. In my case it took more than 2 hours to complete, so be patient.

Other Details

During the process I investigated with console.app to identify a possible cause of the indexing failure, however I was unable to idenitfy any. But this is not the first time that this has happened to me, so maybe I'll find something next time.