OS X: Solving Mail Searching Problems

| TMO Quick Tip

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?

Comments

Gary LearnTech

> Kinda makes you want to punch things just a little bit.

I was finding the resulting knuckle lacerations getting a bit too much recently so have changed over to Shouting Loudly at the screen.  It doesn’t seem to work any better, but the savings I’ve made on bandages and dressings have been put towards a new top-of -the-range iMac.

billglewis

Melissa, you rock girl! Spotlight can be rather a nussance and it needs a good wack every now and then!

Paul Goodwin

Is there any key you can hold down while you start the Mail app that will clean out this kind of stuff? Seems like every application needs some kind of Option-Open to reset the garbage. It’d be nice if a checklist of stuff would come up on that option-start to allow you to pick and choose what to reset. Sounds like the basis of a cottage industry-app cleaning.

Melissa Holt

Thanks for the comments! You guys are too entertaining… grin

Paul, as far as I know, there’s no way to do that—but that would be AWESOME.

—Melissa

Paul Goodwin

At least my Mail app no longer crashes on startup. After I upgraded to OS 10.8, every time Mail started, and it began downloading messages it would crash. It would run fine on a re-open. It had been like that since the very first time I opened Mail after the upgrade. With OS 10.9, it doesn’t do it any more.

dprb

I good solution is to buy InfoClick. It will search you complete Mail database, i.e., multiple mailboxes at once.  http://nisus.com/InfoClick/. Only $15.

Tobias Andersen

Deleting the Envelope Index files did not solve the problem for me.
iOS 10.9.2
Mail 7.2 (build 1874)

I’ll try leaving the spotlight indexing overnight, see if that helps.

Calvin Jr Patten

You are my favorite person right now, that fixed my problem without the 45 min talk I would have been required to have with our IT guy before he would even try to help.

Melissa Holt

Yay, Calvin! I’m so happy to have helped. grin

bradr

Hi Melissa;

I tried both methods… but neither worked. when I minussed the hd from the list, no menu popped up though?

Any other ideas? Much appreciated.

Melissa Holt

Hey bradr,

I’d try excluding your drive from Spotlight again; don’t worry if you don’t get a pop-up, but be aware that you might have to give your Mac a good long time to finish the indexing once you do that.

If that doesn’t work, be certain that you’re clicking on the correct search location in your toolbar after typing in your query.

If nothing seems to be working, you might need to take your machine to the Genius Bar to see if they can look it over for you. I know some people seem to be having renewed issues with some of the more recent versions of 10.9.

—Melissa

ThisIsAdamB

What do I do if none of these work? One of my users has no search capability in Mail for a while now. System wide Spotlight works fine. Since we’re all IMAP here, I’ve set her up with Thunderbird, and that searches fine. I created another account on the machine, and set up the same email account there, and it works like a charm. If I can’t fix Mail, I’m going to have to migrate her entire environment to that second account, and that seems ridiculous to me.

Melissa Holt

Hey Adam,

Assuming you’ve got a backup of her machine, I would definitely try deleting the accounts and re-adding them in Mail before taking the drastic step of migrating her to another user. Again, as long as you’ve got a backup, you could also try removing all associated Mail files—such as .plists—to see if that resolves anything.

Good luck!
Melissa

Log-in to comment