OS X: Solving Mail Searching Problems

On more than a few occasions (read: a lot), I’ve had to help clients figure out why Apple Mail’s search function wasn’t working. It’s strange to be looking right at a message about baseball that doesn’t show up when you search for “baseball” within Mail. Kinda makes you want to punch things just a little bit.

If that starts happening to your Mac, there are a couple of ways to get it going again. First, you could force Spotlight to reindex your entire drive. While this method may take longer, if you’re not comfortable with finding and deleting files from your Library folder as I describe below, it may be the better way for you. For this, visit System Preferences> Spotlight, click on the "Privacy" tab, and then either click the plus button at the bottom-left corner to add your entire Macintosh HD to the exclusions list or drag in the drive from your Desktop if it shows up there. You’ll see a scary warning when you do:

But after you click OK, you should see your drive appear in the list.

Now you’ll want to select that drive and click the minus button to remove it. This’ll force Spotlight to start its indexing over again, and you can click on the Spotlight icon on the upper-right corner of your screen to see its progress.

Sigh. I’m gonna be waiting on that for a while. The things I do for you guys, I swear.

Secondly, you can try a more focused approach by making Mail reindex its database only. To do this, quit Mail if it’s running first. Then click on Finder’s Go menu and pick Go to Folder:

Paste the following path into the box that'll appear and press Return:

~/Library/Mail/V2/MailData

Once the Finder window for that location opens up, delete any files in there that start with “Envelope Index.” As you’ll see below, I’ve got three:

After you delete those files, open Mail again. You may see this kinda-scary box, and if you do, click Continue and let it do its thing.

This step could take a while if you’ve got tons and tons of messages or if your machine isn’t the fastest, so be prepared. 

Anyway, after whichever process you’ve chosen is complete, check to see if searching is working properly. Finally you can find all of those messages your grandpa sent you about everything that’s wrong with the world! Now don’t you feel better?