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

Jan 15, 2017 6:21 AM in response to Maestro1827

It could be worse. I get zero hits regardless of what I search. I can be looking right at an email, search for something that is in it or who it is from and mail tells me there is nothing. So far I have tried each and every thing suggested in this thread, reinstall OS, reindex, unrestrict scope... everything here as of when I am writing this message. Nothing has done anything at all. This is unusual. Typically I find something that works. Not this time. The only thing that has worked is to give up on Apple mail and start using different software.


Given how many people discuss this problem online, and given that it has been a recurrent issue with mail, I find it difficult to believe that Apple is unaware this is and has been is a issue for many customers.

Jan 23, 2017 2:03 PM in response to Maestro1827

Hello


Our home directory is on an OS X server and not on the local drive


I got the following output!


Last login: Mon Jan 23 20:15:14 on console

Macintosh:~ user$ sudo defaults write /Library/Preferences/com.apple.security.appsandbox UnrestrictSpotlightContainerScope -bool true


WARNING: Improper use of the sudo command could lead to data loss

or the deletion of important system files. Please double-check your

typing when using sudo. Type "man sudo" for more information.


To proceed, enter your password, or type Ctrl-C to abort.


Password:

user is not in the sudoers file. This incident will be reported.

Macintosh:~ user$


How can I solve this?


regards

Gérard

Feb 8, 2017 3:29 AM in response to Maestro1827

another example of how a once fine company is now crappy like microsoft. i've used macs exclusively since 1996. you newbys are thrilled because you were so abused by autistic gates & microsoft for so long. you don't realize how BEAUTIFULLY apple products worked before they adopted intel & abandoned motorola & then the brilliant jobs died several years later. THEIR STUFF JUST DOES NOT WORK ANYMORE. it limps along now. a real tragedy. my finder DOES NOT WORK PROPERLY. reindexing DOES NOT WORK...

Feb 11, 2017 8:59 AM in response to matt buswell

1. Thank you! 🙂 Amazingly, against all odds, this incredible Terminal trick worked for us! It had been WEEKS for us where Apple Mail stopped returning any search results at all (even though the Mac's Spotlight search results were still properly returning results from Apple Mail). This Terminal trick fixed the problem within Apple Mail!


2. However, in order for this Terminal trick to properly work for us, we had to go through several steps BEFORE running the Terminal command. Just running the Terminal command on its own didn't work for us. These are the steps that we had to take to get this to work:


a) We started by quitting out of Apple Mail.


b) Then, in the Finder, we went to ~/Library/Mail/v3/MailData, and trashed all 4 or 5 files starting with "Envelope Index". Note that the "v3" folder might have a different number, depending on which version of Mac OS X you're running. v2=Yosemite, v3=El Capitan, v4=Sierra.


c) The Terminal trick still didn't work for us at this point. So then, we launched Cocktail (Mac utility from maintain.se), and used it to do 2 things:

- Rebuild Mail's Envelope Index (on the "Systems > Databases" screen)

- Cleared all caches (on the "Files > Caches" screen). We also went into Options, and selected all checkboxes.


d) Cocktail will automatically prompt you to restart your computer after clearing the caches, which is what we did next.


e) After the restart, Mail still wasn't searching properly. So it was at this point that we yet again quit out of Apple Mail, and then ran the Terminal command:

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


f) Finally, Mail started searching properly again! 🙂

Feb 12, 2017 12:39 AM in response to Scott Rose

Hello


Option e) doesn't work for us because all of our users are networkuser :-(


Last login: Sun Feb 12 09:32:41 on console

Macintosh HD:~ testuser$ sudo defaults write /Library/Preferences/com.apple.security.appsandbox UnrestrictSpotlightContainerScope -bool true


WARNING: Improper use of the sudo command could lead to data loss

or the deletion of important system files. Please double-check your

typing when using sudo. Type "man sudo" for more information.


To proceed, enter your password, or type Ctrl-C to abort.


Password:

testuser is not in the sudoers file. This incident will be reported.

Macintosh HD:~ testuser$


Any suggestion, how to fix it for networkuser?


Regards

Gerard

Apr 4, 2017 9:08 PM in response to Maestro1827

I had this same issue, tried the suggestions here, no luck. After searching a bit online i found someone who had an invisible file at the root of their drive. This didn't show up when doing an LS in terminal either.

running 'mdutil -s <volume>' in terminal gave me the output "Indexing and searching disabled." I navigated to the root of my drive and ran the command "sudo rm .metadata_never_index" to remove the invisible file if it's there. After that I was able to enable indexing with 'sudo mdutil -i on <volume>', indexing status was then enabled and mail searching is working again.


I hope this helps someone

Apr 25, 2017 1:30 PM in response to Maestro1827

I had this problem too, what a frustration!

I tried all what was suggested in these pages and elsewhere: nothing resurrected the searching in Mail.

Last night I decided to leave the computer indexing all night long, started Amphetamine app, so the computer didn't go to sleep but left the screen saver on and lowered the display light to the minimum.

This morning everything works perfectly. In the past days I noticed spotlight sometime was showing the blue bar and sometime not, making you assuming that it was done when it wasn't .

May 21, 2017 9:13 AM in response to matt buswell

Matt - thanks so much for posting this. I too was nervous about it (not being at all familiar with using commands like this in the terminal), but after reading through all the threads again, and looking to see what the sudo command was for, I clenched my teeth and went for it. I have SUCCESS! Thank you.


For anyone else reading this, if it helps, we just recently upgraded to a reconditioned iMac (OS X 10.11.6 El Capitan) from our trusty old iMac late 2006. I performed a 'clean' install, copying over media files and documents etc, and not restoring or creating from a backup. After doing all of this and using the newer machine for a while, I was really frustrated with the mail app because search didn't work at all. I went through a few of the other steps I found in various posts and helpful websites (including manually rebuilding the mailboxes and deleting envelope files from the library - something else that made me a little uneasy); nothing else worked. But this instantly solved the problem. Very helpful. Thanks again.

Oct 31, 2017 6:36 AM in response to Maestro1827

I recently moved my home folder to an external MicroSD card in my laptop (to create space), and search stopped working for me. After trying everything Spotlight related, I realized that my MicroSD was formatted FAT32, and that OS X file privacy restrictions were disabled on that format. As such Spotlight would NOT index anything on that drive.


I backed everything up, reformatted as OS X Extended, restored, and presto...worked! Of course, invalidated ALL of my account permissions and preferences, but I'm up and searching faster than ever.

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 ID.