Apple Event: May 7th at 7 am PT

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

Nov 15, 2007 7:41 PM in response to ecke

Best I'm able to do is manually index my mail:

mdimport ~/Library/Mail/POP-<emailaddress>/INBOX.mbox/Messages

This lets me search mail in Spotlight and inside Mail (as long as I select All Mailboxes). But I don't know why INBOX.mbox isn't being treated correctly by the Spotlight importer. (See previous messages for how to find out if your INBOX.mbox is being imported wrong.)

Nov 16, 2007 2:15 AM in response to Mike Wilkens

MikeW,

so you have the same root cause of the problem, only that you are not able to resolve it by just deleting the additional Mail.app as i was able to. Hm. I'm assuming you did re-login and also restarted your machine to try to force the UTIs to get claimed properly?

If mdimport -d1 ~/Library/Mail still gets you the wrong dynamic UTIs for .mbox there is properly another email application on your system claiming these? Does not need to be Apple only! Keep searching, I think you are near to the solution.

In the meantime the following command (from my first post) eases your import:

find ~/Library/Mail -name "*.emlx" -exec mdimport {} \;

You must copy the command exactly like that, including the space-backslash-semicolon in the end. With that you do not need to specify your Mailboxes maually one by one.

There must also be a way to question the system which application is claiming which UTI. I just can't remember. Try searching macosxhints.com. I'll try too if I find the time.

ecke

Nov 16, 2007 7:45 PM in response to ecke

Ecke, I tried removing one application that might have done something funny (a programming language app) and restarted, with no luck. If there is some app that is causing problems, it's hard to know what it is. The only things I've installed are Factor (that programming language app), StuffIt, a Samsung printer driver, and the Apple developer tools.

OK. But I took your advice and went to look for hints at macosxhints.com. They have a blurb about rebuilding the launchservices database. Here's the command:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

After running this command, my INBOX.mbox is the proper type! I can mdimport ~/Library/Mail and have it index my mail! This is progress. I don't know how to prove that the system is now properly watching and re-indexing new messages, aside from waiting, but this may have solved the problem for me!

Thanks again for your help!

Nov 29, 2007 8:17 PM in response to Mike Wilkens

I just started having this problem on my MacBook Pro laptop and it covered ALL user accts. Up until a few days ago, search 'Entire Message' worked just fine, but today, no results on any search. I tried all the hints in this list to no avail.

I finally got it to work but turning off Time Machine which was pointing to a remote drive connected to another Mac and mounted wirelessly. Note that it did take over 24 hours for the initial backup to complete which was early this AM. I noticed this evening that another index was running on the remote backup drive. I tried turning that off in the 'Privacy' tab of Spotlight, but even after a reboot, I still couldn't search in Mail.

Finally, turning off Time Machine AND rebooting magically fixed the problem. All searching in mail now works for all accounts and is fast as to be expected.

Dec 4, 2007 2:52 AM in response to ecke

as a lot of other people, I am unable to search my mailboxes in Mail 3; I read the discussion and suggestions; I tried out the following one (after checking that I had only one Mail.app on my MacBook Pro and turing off TimeMachine:

I entered mdimport ~/Library/Mail in terminal and I got the following error message:
* Failed to decode 8bit data, treating as binary
No idea what all that means

Dec 11, 2007 11:13 AM in response to SalviusDE

OK, so I tried this "solution". My problem was not exactly the same as that described, in that I could search mail using All Mailboxes and Entire Message, but not individual mailboxes. I didn't get any font problem show up. Exported Mail and re-imported everything, let Spotlight re-index the whole drive. NOW I cannot get any kind of search in Mail at all!

Big step backwards!

Paul

Dec 11, 2007 1:53 PM in response to Mike Wilkens

Thank you, MikeW. I was having the same problem with Spotlight not indexing any of my mailboxes--they all showed as "package" instead of "Mail Mailbox". The following solution was suggested, and even though it seemed a bit scary, I tried it. And, it worked perfectly.

Enter these commands in Terminal--

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

mdimport ~/Library/Mail

This worked like a charm. It indexed all of my mailboxes, even nested as deep as three levels. Now, I can find specific phrases in both the Finder and Mail searches.

Thanks, again.

CarlY

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.