You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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

Mar 8, 2016 6:49 AM in response to David Estes

Hmmmm. Now that you respond that way it got me thinking. I had previously used the suggestion that I add my user folder to the "do not search" list in Searchlight > Privacy pane; then go back and remove it. That just might have started up searching again, and I only noticed results after a half hour when I did the header search box delete-add.

Mar 17, 2016 8:46 AM in response to LenTS

Awesome! Open Mail and go to mailbox and click rebuild!!! WORKS! Thanks @LenTS


OMG after transferring data to a new iMac i tried everything to make the mail search work again. Reinstalling OSX 10.11, setting back the iMac using time machine but nothing worked.


On one occasion I realised the problem did occur when I transferred a backup to a new iMac and imported a user profile from an old user which didn't exist in the latest backup anymore. By importing the backup again with latest users profiles everything worked fine. Maybe it was just a coincidence that it helped and the rebuild option would have been the real solution.

Mar 29, 2016 5:16 AM in response to bala@apple

I experienced the same issues. I followed multiple corrective actions as discussed on the forum. This instruction worked for me with immediate effect. Thanks for your input - appreciated.


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

Mar 30, 2016 9:31 AM in response to craigfromdevon

Thanks for the insight. I tried your post and sadly I still have the same issue - incomplete search results. For instance in entering an email address into the search field I get one result. Then as a start deleting from the end of the email address, I obtain more results.


Actually I was hoping that with the recent software update our friends at Apple would have fixed this problem. Sadly they have not.

Apr 5, 2016 1:35 PM in response to craigfromdevon

Yep - I ran the command in Terminal, then reindexed Spotlight. Still incomplete results. Searching "All" in Mail for a specific email address, I receive maybe 2 results. However once I start deleting from the end of the address forward, more results appear.


This may also be a problem with relatively large email databases, which mine is. Definitely still seems like an Apple problem/ bug.


Thanks for the good work, however, as it has solved the problem for some.

Apr 13, 2016 8:05 AM in response to Maestro1827

Airmail? While there have been a number of fixes which have worked for some, obviously there are any others (myself included) who still have the same problems when searching mail. Perhaps my email stack is higher, maybe it's the combination of number of emails and different inboxes I use - I don't know.


Since Apple has yet to fix this problem, I am now looking for another email app. Anyone have any experience with Airmail? Any other good apps out there? No, I will not use Outlook as I avoid buggy MicroSoft products.


de

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!

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.