The Robservatory

Robservations on everything…

 

On the uselessness of search in macOS Mail

For the last couple macOS releases, I’ve had nothing but trouble searching in Mail. Note that I didn’t write “trouble searching mail,” but rather, “trouble searching in Mail.” For example, today I needed to find an email from my business partner Peter about a hidden pref in Butler. (I was hoping this pref could help a user who was having problems with the pasteboard in a certain app.)

Based on a document on my hard drive, I knew the name of the default was Pasteboard Normalization Interval, but I couldn’t remember the syntax of the defaults write command to set its value. So I searched in Mail…

So clearly, no emails in my database contain the words I’m looking for, right? Here’s the exact same search, run in Spotlight:

Not one but two email messages match my search, and provided the needed syntax for the command.

Wait, I know what you’re thinking: “Ahh, look, it’s in quotes!” Doesn’t matter; searching Mail for "Pasteboard Normalization Interval" still results in zero matches. Searching on even one word of the phrase, like Normalization, also finds no matches.

Again, I know what you’re thinking: “Oh, I bet the Mail index is screwed up.” Nope; even after rebuilding the index on all 250,000+ messages in my database, no matches are found. (And yes, I let the index complete its rebuild, which took hours.)

I’ve heard from others that search in Mail works for them. But it’s a no go for me, and I know, for others. So something’s wrong, but I don’t know exactly what it is, nor how to fix it.

So for now, I have to rely on Spotlight to search Mail…or a third-party app, but more on that in a bit.

9 Comments

Add a Comment
  1. I have encountered the same frustration. Amazing that they can’t get the search function working correctly. I have been looking at other mail applications as much as it would pain me to move but allow for great search functionality.

  2. So why not just use Spotlight? Seriously…it works, and I’m finding it more and more useful as I run into folks who’ve got a lot less “experience” with OS X than I do…I’m an IT professional that also does a lot of helpdesk work and I’m finding that I “know” a lot less than I think I do. Spotlight is actually really efficient at searching, it’s always available and it searches everything.

    1. Spotlight is efficient, but you can’t easily tell it to just search Mail from its Cmd-Space pop-up. You can in Finder, if you take the time to build the search. But searching in Mail is one of those things that should “just work.” They’re stored as text files, Spotlight has them indexed … so why does Mail fail to find them?

      -rob.

      1. Don’t know if the kind:mail search operator is another that’s broken for you in 10.12, but I use it with Spotlight in 10.11. Admittedly, I do have Keyboard Maestro replace the text “kdm” with “kind:mail” for making it easier to do. More than anything, sounds like Spotlight is out of whack either in 10.12 or on your system. Not good either way.

        1. Thanks – I always forget about the kind: modifiers. That does work in 10.12. And Spotlight in general is working fine, just not Spotlight in Mail. I don’t think it worked for me in 10.11, either. But as noted, I’ve rebuilt the index files, so I have no idea what to try next.

          -rob.

  3. I was just noticing the same problem, but in my case it feels like it’s for the first time. I’ve always relied on Spotlight for searching Mail, and for the last week or so it has failed me horribly. What I’ve noticed is that it will return more results for someone’s name if I don’t specify the “from” designation. And it has trouble finding the simplest things such as subjects.

    In my case, I am running Mail Butler, MailTags, and Mail Act-On. Wondering if any of those could be affecting Spotlight. I may try to run without them and check.

    1. I don’t run any Mail plug-ins at all. I’m contemplating a nuclear action, exporting all my mailboxes one by one, then trashing all prefs, and importing again, testing Spotlight after each import.

      -rob.

  4. From poking around on this issue… If you open or Quick Look the file in advance you can check the setting, but apparently

    /Library/Preferences/com.apple.security.appsandbox

    should be set to and if it isn’t

    sudo defaults write /Library/Preferences/com.apple.security.appsandbox UnrestrictSpotlightContainerScope -bool true

    will adjust this, which apparently corrects the Mail search issue.

Leave a Reply

The Robservatory © 2017 Built from the Frontier theme