Skip navigation
This discussion is archived

Leopard's Spotlight doesn't search Mail messages

16519 Views 89 Replies Latest reply: Jun 28, 2008 5:28 PM by thebryceman RSS
  • Carl Youngmann Calculating status...
    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
    iMac G5 (2), MacBook, Titanium Powerbook, Apple IIe, Mac OS X (10.5.1)
  • Manco Inca Calculating status...
    Currently Being Moderated
    Dec 14, 2007 11:58 PM (in response to Mike Wilkens)
    I had a variant of this problem. I could search "Entire Message" in Mail, but nowhere near as many results appear as I think should for any given search. That may be somewhat subjective, but I also couldn't get any results from Mail to show up in the Spotlight menu. I had not made any changes to the Spotlight preferences, and I double-checked to make sure that mail messages are checked to be indexed and searched. Even if I search for key words or phrases present in an email that I'm looking at, nothing mail-related was showing up in the Spotlight menu.

    After I ran the mdimport ~/Library/Mail, results started showing up in the Spotlight menu. We'll see if that resolves my problem permanently. In any event, it appears that there is some indexing anomaly affecting some Leopard users.

    I'm using Gmail with the new IMAP configuation.
    MacBook Pro, Mac OS X (10.5.1)
  • Andrew Harris1 Calculating status...
    I discovered recently that when I searched for "entire message" I only got old results... I think the results were from before my install of Leopard. Anyway I reindexed my whole drive and to my surprise I got 0 results when I searched my mail. After reading all the posts here I tried everything and this is what I discovered...

    1) I can force an index using mdimport and the search works again (sort of see 2) but this command does not permanently add the mail directory to the spotlight index so this is a temporary solution at best.
    2) Searching "all mailboxes" works after reindexing but not searching individual mailboxes.
    3) I tried the add/remove from privacy list trick. No dice. Sometimes mdworker seemed to be doing something but my email messages are never added.
    4) Nobody has mentioned this before but everything BUT the emails are being indexed. I can search for attachments and I get results! This is happening automatically. This means spotlight is indexing the mail folder but is deliberately NOT indexing the mail messages.
    5) I checked and my UTI's are fine.
    6) I created a new user and setup mail thinking that the problem had to do with a user level issue. Same problem. This is a system level problem.
    7) I haven't tried the double exposure solution yet... it sounds like would take the whole afternoon. Has anybody actually had success with this?

    Well thats where I'm at. Irritating to say the least.

    Cheers,
    Andrew
    Powerbook 17 2.33, Mac OS X (10.5.1)
  • Al Chemist Calculating status...
    I've had the same problem as well, which seems to have started after applying the Security Update 2007-009 (although that may just be a coincidence).

    Specifically, I couldn't search on Entire Message in my Inbox in Mail. None of the solutions suggested here worked (I also tried the Double Exposure solution as far as checking for bad fonts (didn't find any); I didn't go farther because of the time it seemed it would take).

    Using the mdimport ~/Library/Mail command generated lots of "Failed to decode 7 bit data, treating as binary", "Failed to decode plain data, treating as binary", and "NSDataMessageStore: couldn't find body" messages. Rebuilding the Spotlight index, checking for multiple copies of Mail, etc. didn't help.

    What finally worked was the use of the Spotlightindexer program (http://www.macupdate.com/info.php/id/18335) on my Mail folder. Voilà! All the mail was searchable in my Inbox using Entire Message, and email I've received since then has also been searchable in the body.

    What I believe Spotlightindexer does is to put a GUI interface on various mdimport commands, especially "mdimport -f ~/Library/Mail" (a forced import, which may bypass corrupted files). Maybe others knew about this already, but it was news to me, and has worked—for now.

    Tim
    Power Mac G5 (dual 2.5 GHz), Mac OS X (10.5.1)
  • Andrew Harris1 Level 1 Level 1 (90 points)
    I just tried using Spotlightindexer and it seems to be pretty much a from end for mdimport. New messages are not indexed... at least not for me.

    I got excited for a minute.

    Cheers,
    Andrew
    Powerbook 17 2.33, Mac OS X (10.5.1)
  • PaulSelden Level 1 Level 1 (35 points)
    Hi all

    Here's my latest on this problem. I rebuilt all mailboxes (you need to do this individually, so it takes ages). Forced Spotlight to reindex. Now, I can search individual mailboxes as well as All Mailboxes on all criteria (From, Subject, etc.) EXCEPT Entire Message!

    Also, if I add a mailbox folder to the Privacy tab in Spotlight (to prevent it being searched) it does still include the folder in the search. My conclusion is that it seems this is a Spotlight problem rather than a Mail one.

    Paul
    MacBook Pro, Mac OS X (10.5.1)
  • IMRAN Level 2 Level 2 (470 points)
    Count me in as a fellow sufferer of this problem.

    Imran
    PBG4/17,PBG3/500,PBG3/300,PMG4,eMacG4, Mac OS X (10.5.1), Nokia 9500, Sony Ericsson P900, Phaser 860DP, iPod, Nikon 5700, Nikon S6,PPC6700
  • distractiboy Calculating status...
    I have this problem as well and it is driving me insane.
    PowerBook G4 12", Mac OS X (10.5.1)
  • fpeters Calculating status...
    Count me in as well on the failure to search entire messages. I tried removing content_index and .index.ready files in one of the affected mailboxes, but to no avail. This is really, really annoying.
    Mac OS X (10.5.1)
  • Terrell Smith Level 4 Level 4 (3,010 points)
    Currently Being Moderated
    Feb 8, 2008 8:15 PM (in response to fpeters)
    Everyone, please contact Apple about this issue, through Feedback:
    http://www.apple.com/feedback/macosx.html

    and tell them exactly what is happening.

    It seems that Apple does NOT yet have a good solution for this. I was in the Apple store and a genius worked with my machine for two hours trying to get my Mail to properly index. Another genius helped him as well. It was only partly successful.

    So Apple needs to hear from all of us about this problem, so they can get it fixed.
    MBP C2D 2.33 / Dual 1.8 G5, 2 GB RAM / TiBook 400, 1GB RAM, Mac OS X (10.5.1)
  • Kevin Ludwig Calculating status...
    Awesome, ecke!

    Your solution worked for me when nothing else would. I was about to try the very lengthy process described here (which I discovered in another post somewhere): http://www.dextechs.com/osx105spotlight.html

    But I didn't have to resort to that. I had another Mail.app, on a separate partition, leftover from my Panther days (10.3). I deleted that, emptied the trash, ran mdimport ~/Library/Mail, and... still no luck. But after a reboot... SUCCESS!!!

    Thanks much,
    Kev
    eMac 1.25 GHz, Mac OS X (10.5.1)
  • Terrell Smith Level 4 Level 4 (3,010 points)
    It doesn't work for me. It did add the ability to search ALL Mailboxes, but it won't search any individual mailboxes, such as the Inbox.

    I do not have another Mail.app lurking anywhere either.

    And a reboot changed nothing.

    I think it's a bug Apple needs to fix. So please send them your feedback.
    MBP C2D 2.33 / Dual 1.8 G5, 2 GB RAM / TiBook 400, 1GB RAM, Mac OS X (10.5.1)
  • PaulSelden Level 1 Level 1 (35 points)
    Not a helpful reply, I'm afraid, but just want to concur exactly with Terrell.

    I have tried ALL of the supposed fixes. I have no additional Mail.app. I am at exactly the same point now as when "upgrading" to Leopard. Can search on Subject, From and To in all mailboxes, All Content on All Mailboxes, but NOT All Content on individual mailboxes, such as Inbox. This is very frustrating. Also, need to do a manual mdimport occasionally to update even this limited searching ability to new mail.

    Hope there is a fix for this soon.

    Paul
    MacBook Pro, Mac OS X (10.5.1)
  • Kevin Ludwig Level 1 Level 1 (5 points)
    I responding a little too quickly & enthusiastically, I'm afraid. Though I'm thrilled that Spotlight has now indexed my existing mail, and I can successfully search 8 years' worth by content, it doesn't index new mail unless I re-run the mdimport command... bummer.

    Kevin
    eMac 1.25 GHz, Mac OS X (10.5.1)
  • Terrell Smith Level 4 Level 4 (3,010 points)
    Paul, there is some sort of strange comfort knowing you're not the only one having this strange thing happening.

    I keep my machine "clean", do regular updates, fixing of permissions, etc.

    The only thing I can guess happened is either an update, plugging into TimeMachine, running the HD full, or something. I'm not absolutely sure when the problem started, because I didn't notice it right away, just that "something wasn't working right."

    Then I could observe that a search got worse and worse, and finally even "All Mailboxes" returned nothing.

    Something, somewhere, stopped working.

    Using the Terminal command mdimport ~/Library/Mail allows it to find messages when searching "All Mailboxes" but even then, NO NEW mail, which is a real bummer.

    When two Apple geniuses at an Apple store cannot figure it out after two hours, it's a serious problem.

    Please send feedback to Apple about it. They need to hear that there are others with the same problem, so they will find a fix.

    Message was edited by: Terrell Smith
    MBP C2D 2.33 / Dual 1.8 G5, 2 GB RAM / TiBook 400, 1GB RAM, Mac OS X (10.5.1)

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.