Mail Search not working El Capitan

With the new mail in El Capitan, when I search for mails from a sender, it does not bring up most of the emails from that sender. This renders the search function in mail unusable.

iMac, Mac OS X (10.0.x)

Posted on Oct 1, 2015 10:41 AM

Reply
116 replies

Apr 30, 2016 9:25 PM in response to Maestro1827

Wow, I have tried everything in this thread except for reinstalling OS X, and still I am unable to search my email on my Macbook Pro and 2011 iMac. Both running El Capitan. I just ordered a new 4k iMac, I hope I don't continue to have this problem!


1. /Library/Preferences/com.apple.security.appsandbox UnrestrictSpotlightContainerScope -bool true

-bash: /Library/Preferences/com.apple.security.appsandbox: No such file or directory


2. Removed all files that begin with Envelope* in ~/Library/Mail/V3/MailData.


3. Rebuilt all of my mailboxes.


4. Signed out of then back into icloud.


5. Tried disabling my gmail account.

May 17, 2016 10:38 AM in response to Maestro1827

THIS FIXED IT! After much difficulty, this post fixed it. Thank you. RIck


Reply by matt buswell on Dec 8, 2015 1:57 AM Helpful

Open terminal from the utilities folder.


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


Press return


enter your password.


open mail


Mail search will now be back to normal


See the answer in context

May 17, 2016 2:35 PM in response to Maestro1827

So being another person who tried everything listed and nothing worked...I finally found something that did. The issue seems to be with Spotlight and the index of Mail. This is what worked for me:


Open Terminal found in /Applications/Utilities


Inside terminal run the command below and then enter your admin password when/if prompted:

sudo mdutil -E /


You will then see the following output in Terminal:

/:

Indexing enabled


For those not familiar with the mdutil command, here is information from the man (manual) page:

mdutil -- manage the metadata stores used by Spotlight

-E This flag will cause each local store for the volumes indicated to be erased. The stores will be rebuilt if appropriate.


What you are effectively doing via mdutil is telling it to discard and rebuild the index for / (or "root" aka Macintosh HD). After running the command, you can activate Spotlight (CMD + Space) and try and search for something and you will see the indexing progress. User uploaded file


I noticed Mail search was fixed a few minutes after I executed the command in Terminal (Maybe Mail gets re-indexed first?). I did not have to wait for Spotlight to complete the index of the entire drive before Mail search worked. Note, Spotlight searches will be limited until the complete index is completed, but Mail worked pretty much right away.


Hope this helps!

May 18, 2016 1:54 PM in response to Maestro1827

I've done this, and still run into issues. When Mail search (and/or Spotlight) aren't responsive, an easy fix I've found:


In Terminal, enter:

$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

(You will be prompted for your admin password)


Then:

$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist


Unlike other methods, this doesn't take much time at all, and I haven't come across any adverse effects when using it.

May 23, 2016 2:26 PM in response to Maestro1827

I tried all the commonly recommended solutions and none of them worked - deleted envelop folders, reinstalled OS X, tried the terminal command. No luck.


After I saw the post suggesting that Cocktail may have been causing an issue I decided to try updating Onxy. (I use that instead of Cocktail.) I had tried using Onyx to rebuild the index before but no luck (was using an older version). When I updated to 3.1.6, and had it rebuild, and delete the old version... it worked. It had to reimport the mail, but I now get results when I search mail again. (YEAH!)

Oct 12, 2016 5:01 AM in response to Maestro1827

OK - I have exactly this problem in Sierra, but only for the last 48 hrs (Sierra having been installed for weeks). I have tried all of these methods including re-installation of Sierra, in/out of iCloud and the Terminal code - and nothing works. This is a HUGE problem for me as I get 100's mails/day and really need to be able to track topics.


FWIW the mail search on my iPhone (7) still works, presumably via the server but this is very clunky as a way to live!


Help urgently needed!


Thanks


MacBook Pro (Retina, Mid 2012), 8GB

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Mail Search not working El Capitan

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.