However, when Exporting them from the NEW computers (or NEW OS) Mail app theyre somehow fixed - or it may be when Re-importing them that those index files are rebuilt.
I have reindexed spotlight, reset NVRAM etc iMac 20 4Gb RAM 1Tb HD High Sierra 10.13.3.
Lync Not Working On Sierra Mac Spotlight Would
Nor in mail, nor in the mac spotlight would I be able to find my emails (not even mdfind).
The entire Mail tree on the file system had an extended attribute com.apple.quarantine, which you can find this way: ls -ld Mail drwx------ 14 simonpie staff 448 29 mar 19:51 Mail com.apple.quarantine 19 So I removed the extended attributes this way: sudo xattr -rd com.apple.quarantine Mail I added the Library folder to spotlight exclusion and removed it 20 seconds later.
And tadam. Spotlight was reeindexing all my mails and emails were appearing in both mail and spotlight.
I unfortunately upgraded my MacBook Air (11 inch, 4,1 mid 2011) to Mac OS 10.13 (High Sierra from 10,12) and Mail search immediately stopped working.
I am also using a Mac Pro ( 5,1) mid 2012 which I have not upgraded to High Sierra (and probably never will) which runs Mac OS 10.12.
This machine has absolutely no problems with Mac Mail or anything else.
On the MacAir I have now abandoned Mac Mail and installed Thunderbird mail which runs perfectly.
I also have rebuilt the spotlight indexes to no avail - as I said spotlight works, just not searching from inside the macmail application.
Its not pretty, but it works Hopefully this works for you as well.
For me the issue appeared to point to the local folders beneath my On my Mac section of Mail.
Emails stored in those folders were simply not being discovered when performing Mail searches.
This led me down a path that ultimately gave me the idea to test something drastic.
Exporting those folders (as if I were moving everything to a new computer), and then Re-importing them again.
I first tested this with one small folder under On my Mac since it would take less time to test a small folder versus a large one.
I tested some searches in Mail for messages I know should show in the results but didnt.
Of course I documented all of this so that I could re-test once that folder and messages within it were re-imported.
It worked Mac Mail reindexed those folders and their contents as if they were new when re-imported.
My theory here is that when upgrading, or moving to a new computer with a different OS than the one youre moving from (i.e.
OS of the computer youre Exporting FROM and the OS of the NEW computer youre Importing TO are different), the actual folders where those emails reside on your computer (under the LibraryMailV5 folder) contain incompatible index files and are not updated (or at least not properly) when moving those messages.