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

Leopard's Spotlight doesn't search Mail messages

Leopard's Spotlight isn't searching email messages. I made a clean install of 10.5, and have two POP accounts. The message files are right there under ~/Library/Mail/... . I rebuilt the index for the system volume by adding and then removing the volume from the Privacy zone in Spotlight preferences. I also tried some of the command-line suggestions posted elsewhere for this problem. I recently added my backup volume to the privacy zone, but other than that the zone is empty.

But the problem remains. Outside Mail.app, Spotlight never comes back with search results that are mail messages. Inside Mail.app, searching "entire message" returns 0 results. Does anyone know how to diagnose this problem? Can I see if a particular file is included in the metadata index?

PowerMac G5, Mac OS X (10.5), clean install

Posted on Nov 4, 2007 3:32 PM

Reply
Question marked as Best reply

Posted on Nov 4, 2007 3:36 PM

Mike,

In System Preferences>Spotlight>Privacy do you have any files excluded?

Matt
89 replies

Feb 20, 2008 12:32 PM in response to Mike Wilkens

You are not alone. Spotlight is broken. It won't search Mail messages correctly.

So far, nothing I've tried has given me the ability to search Mail messages under "Entire Message" for any mailboxes.

"From," "To," and "Subject" searches work, but not "Entire Message."

Doing *mdimport ~/Library/Mail* in Terminal adds current messages to an "Entire Message" search for "All Mailboxes" but does not help an individual mailbox search, nor search any new messages.

_Here's what I've tried:_

Fixed permissions with Disk Utility

Re-booted (many times)

Dragged the hard drive icon to Spotlight's Privacy window, then off again

Installed 10.5.2 from Software Update

Re-installed OS X 10.5.2 from the combo update

Ran Diskwarrior 4.1 Rev. 42, did both a rebuild of the startup HD, and Files

_In Terminal:_

Turned off indexing, then back on again
sudo mdutil -i off /
sudo mdutil -i on /

Turned off indexing, deleated the Spotlight index, turned indexing back on again
sudo mdutil -i off /
sudo rm -r .Spotlight-V100
sudo mdutil -i on /

Deleated the never index file (there was none)
sudo rm .metadata neverindex

Tried to rebuild the index
sudo mdutil -E /

Added Mail to the index
mdimport ~/Library/Mail
Received an error message: mdimport[188:807] * Failed to decode 8bit data, treating as binary

Doing mdimport ~/Library/Mail adds messages to the "Entire Message" "All Mailboxes" search, but no new messages get indexed.

_Genius at Apple Store:_

I spent two hours with a Genius at an Apple Store, he tried everything he knew, plus all of the above, plus asked another Genius for help. They were unable to fix Spotlight's search.

_Apple Discussions:_

I have asked this question on Apple Discussions. Several others are experiencing the same problem. So far no one has been able to come up with a solution. The number of people with this problem is growing:

Topic : Spotlight does not search Mail messages
http://discussions.apple.com/thread.jspa?threadID=1366101
Topic : Search "Entire Message" returns "0 Found" in mailboxes
http://discussions.apple.com/thread.jspa?threadID=1341832
Topic : Spotlight died on me
http://discussions.apple.com/thread.jspa?threadID=1226645
Topic : I can't search through my inbox!
http://discussions.apple.com/thread.jspa?threadID=1387827
Topic : Leopard's Spotlight doesn't search Mail messages
http://discussions.apple.com/thread.jspa?threadID=1219030
Topic : Mail Search
http://discussions.apple.com/thread.jspa?threadID=1347387
Topic : Mail Won't Search
http://discussions.apple.com/thread.jspa?threadID=1204827
Topic : Search does not work
http://discussions.apple.com/thread.jspa?threadID=1254966
Topic : Mail search not working
http://discussions.apple.com/thread.jspa?threadID=1289253
Topic : Unable to Search Mailbox
http://discussions.apple.com/thread.jspa?threadID=1232504
Topic : Why is Search in Mail.app busted?
http://discussions.apple.com/thread.jspa?threadID=1403758
Topic : Mail Search comes up empty
http://discussions.apple.com/thread.jspa?threadID=1378473
Topic : Search "Entire Message" not working with Smart Mailboxes?
http://discussions.apple.com/thread.jspa?messageID=6548355&#6548355
Topic : Mail searches yield no results! Smart mailboxes also yield no results!
http://discussions.apple.com/thread.jspa?threadID=1395508
Topic : 10.5.2 Mail.app search still not working (Entire Message)
http://discussions.apple.com/thread.jspa?threadID=1389466


Obviously, something is broken.

*PLEASE SEND FEEDBACK TO APPLE:*
In Mail, under Mail in the Menu, use "Provide Mail Feedback" to send your feedback to Apple. This sends general information to Apple about your Mail set-up, which should help them get this resolved.

If you do not wish to send them general info from Mail, you can use this link to send feedback:
http://www.apple.com/feedback/mail.html

Terrell

Feb 21, 2008 3:05 PM in response to sgginc

I was finally able to get Spotlight and Mail searches working again, but they way I did it was not pretty. Do not do this!

I followed a link to a web site which suggested using the Terminal command (which is what Ken suggests earlier in this thread):
sudo rm -rf /.Spotlight* to remove all traces of Spotlight.
WARNING: This command is very dangerous!

I accidently typed it thus (DO NOT DO THIS!):
sudo rm -rf / .Spotlight*

See the difference? There is a space after the slash.

What does it do?
sudo = run the following command with root priveleges. root has the permission to do ANYTHING on the system

rm = remove a file

-rf = The r means do it recursively, removing empty folders. The f mean force (ie. don't ask if you really want to remove each file)

"/ .Spotlight*" (with the space) means passing two things to remove to the command instead of one: remove the folder "/" and also everything whose name begins with ".Spotlight" from the CURRENT folder. "sudo rm -rf /" means "Using root privileges, remove all files and folders (and everything they contain) from my computer without asking if you're sure you want to remove them."

I was watching the Console when I did this, and was startled to see so many files being listed, then noticed that the icons of files and folders in the Finder window in the background were disappearing!

_So through my typo, I was erasing the whole hard disk!_

A CTRL-C stopped the process, but the damage was done. Every application was already gone.

So I got a chance to find out if Time Machine really worked. Fortunately, I had a current backup.

BTW, _never use Terminal commands without having a current back up. You can do some serious damage!_

After a Restore from Time Machine (took four hours), I needed to Fix Permissions (the Group was incorrect on 15,000 files).

Time Machine and Spotlight ran full blast for some time. I just let it run overnight.

When I first ran Mail again, it acted as though it was the first time it was run, and asked if it could import my Mailboxes. When it was through importing all my mailboxes, Search worked again!

So - how to fix the broken Search in Mail? Maybe just make a complete backup of everything, then restore it will do the trick.

Mar 3, 2008 6:08 AM in response to Mike Wilkens

This finally worked for me:


1) Backed up my data
2) Downloaded "MainMenu" ( http://www.santasw.com/)
3) Cleaned out every system and user cache that I could with MainMenu.
4) Ran every other maintenance or cleaning task.
5) Repaired permissions.
6) Asked MainMenu to delete my Spotlight index.
7) Waited for OS X to start reindexing. It did... took about an hour.
8) Started up Mail... "Search Entire Message" was unavailable at first, and then it came back.

good luck.

Mar 5, 2008 6:51 PM in response to mic8512

I was talking to tech support (actually I got bumped to a product specialist) for quite a while today and finally got this problem solved. Here was what happened (from memory):

Start Mail
Manually load your mail from the server (to get to a known 'current' state)
Quit Mail
Delete ~/Library/Preferences/com.apple.mail.*
Delete ~/Library/Caches
Move ~/Library/Mail to the desktop in preparation for a subsequent import
logout
login
Start Mail
Setup your account by providing your email address & email password etc. at the prompts.
Wait while any/all of your emails on the server get read in again.
Select all those new emails in your InBox and delete them
File -> Import Mailboxes and select the Mail folder on your desktop
Let the import occur, Spotlight indexing occurs along the way
Drag the various mailboxes within the new Imported mailbox back to their usual locations
Test if Mail can now search contents like it's supposed to
Delete the Mail folder on the desktop when you're happy it all worked

It all worked for me, and subsequent received emails are all indexing just fine.

Good Luck.

Mar 5, 2008 7:11 PM in response to Jessica Mark

Thanks Jessica!

I have finally got it to work.

Actually, "Archive and Install" is not as easy as it sounds. Give yourself a night and a day to do it! You need to go back to the original Leopard install disk. The explanation is here: http://docs.info.apple.com/article.html?artnum=301270. Even though I used the "Preserve Users and Network Settings" the install stopped at less than a minute from the end (after a couple of hours) and would progress no further. So I quit the installer and, ignoring all the dire warnings, restarted. Everything was fine except not all the settings got transfered, so I had to manually move a load of preference files.

Now you need to upgrade using Software Update to get to where you were when you started, and also it is best to reinstall all software from original disks (what a pain). After I got Address Book back up to speed, Mail ceased to open at all, and this was fixed by reinstalling com.apple.mail.plist from the latest Time Machine backup.

Finally, when everything was back together again, I can now search on individual folders with in Mail using Entire Message.

I hope this works for others too.

Paul

Leopard's Spotlight doesn't search Mail messages

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