Topic : Unable to Search Mailbox

Topic Archived This topic has been archived - replies are not allowed.


This question is not answered. "Helpful" answers available: 2 . "Solved" answers available: 1 .



            Permlink
            Replies : 10 - Pages : 1 - Last Post : Feb 27, 2008 9:10 PM by: epá zug
Ian Park

Posts: 2
From: Essex UK
Registered: Nov 11, 2007
Unable to Search Mailbox
Posted: Nov 11, 2007 5:03 AM
 

When I type a search in the box to find an e-mail, nothing happens. I can't search anything at the moment in the new version of mail 3.0. Can anyone help please? Thanks.

Power PC G4 867 MHz 640 MB SDRAM   Mac OS X (10.5)    
Ben Harris

Posts: 115
Registered: Sep 27, 2004
Re: Unable to Search Mailbox
Posted: Nov 11, 2007 7:07 AM   in response to: Ian Park
 

I am having the same problem but only when I search "entire mailbox", I have seen several posts about this with lots of 'fixes' having to do with reindexing and rebuilding your mailbox but nothing has worked for me. This started with Leopard.

PM G5 Dual 2 GHz      
Ian Park

Posts: 2
From: Essex UK
Registered: Nov 11, 2007
Re: Unable to Search Mailbox
Posted: Nov 11, 2007 11:22 AM   in response to: Ben Harris
 

Yes this happened as soon as I loaded Leopard. It is also the same at work when I use a PM G5 Dual 2 GHz.

Power PC G4 867 MHz 640 MB SDRAM   Mac OS X (10.5)    
javierbargas

Posts: 1
From: Switzerland
Registered: Nov 23, 2007
Re: Unable to Search Mailbox
Posted: Nov 23, 2007 1:39 AM   in response to: Ian Park
 

Same here for me. Rebuildidng the envelope, reindexing spotlight, even reimporting the mail folders: nothing worked. Quite desperate!

  Mac OS X (10.5.1)    
Ben Harris

Posts: 115
Registered: Sep 27, 2004
Re: Unable to Search Mailbox
Posted: Nov 23, 2007 11:05 PM   in response to: javierbargas
 

What worked for me was deleting an old copy of mail.app I found on my secondary hard drive and then did that mdimport thingy. I will paste the message that did it for me:

___________________________________
Hahaaaa! Solved it - at least for me...

Please read the whole explanation first before just gabbing any presented commands and executing them in the Terminal. The solution requires no Terminal.

I had exactly the same problem described by MikeW and JJ. I tried everything like you before at no avail, too. But I tried one more thing that did work and indexed all my mail. Here is what I did at the command line. Don't type the command right away. It will work, but this is not the root cause of your problem, I present it just to explain:

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

This searches for the individual message (*.emlx) files themselves and throws them one by one onto the mdimporter which imports them just fine. Still, a plain mdimport ~/Library/Mail would not work which pointed me in the right direction: Spotlight did not "see" these individual message files. But Why?

I fiddled a bit with file/folder permissions since I also simply upgraded from Tiger and ended up with old Tiger permission based user accounts. No result. I discovered, that in Finder the mailboxes, say ~/Library/Mail/Mailboxes/INBOX.mbox etc. were displayed as package files instead of folders. Strange. So again I tried mdimport -d1 ~/Library/Mail now with a bit of debugging. Aha! Spotlight imports this folder as type 'dyn.ah62d4rv4ge81g45mr3wgn8a', or similar, a dynamic UTI, instead of with 'com.apple.mail.mbox' as what it should have been. Since this unknown dynamic UTI dosn't mean anything sensible to Spotlight, it would simply skip the folder, not scanning it's contents with the well known result that mails cannot be searched by content.

So, what is essentially overwriting these UTIs? Especially because this would not happen in another Leopard-created user account. I felt guilty as I added some custom UTIs in the past, but nothing to do with mail at all. So who carries UTIs for Mail.app? Well... Mail.app! Another Mail.app? YES! I remembered, that I had an older complete pre-Spotlight system backup on my current system, including all applications including Mail.app in version 1.3.something. AFAIK only with Mail 2.0 Apple changed the way Mail saves messages and they apparently also changed the UTI of .mbox to the new format. I simply deleted the old version of Mail.app. Immediately after that the icons of the .mbox changed and I could open these folders in Finder. I tried again mdimport ~/Library/Mail and - boom - Spotlight imported all my mails!

Long story to explain my thoughts, here are 5 steps for you to try:

1. Search your system to find out if you have multiple different copies of Mail.app. You can do that with Spotlight/Finder or enter in the terminal:

sudo find / -type d -name "Mail.app" -ls

(You need to be admin to sudo, type your password when prompted)

2. Locate and check the found versions of Mail.app in Finder via the get info window.

3. Delete all but the actual copy of Mail.app in /Applications from your system (empty trash!).

4. Enter the following line in the terminal to have Spotlight import your messages:

mdimport ~/Library/Mail

Should take much longer now, depending on the number of mails you have.

5. Check the result by searching mail content in Mail/Finder/Spotlight, enjoy!

Note: If you did find and delete old versions of Mail.app, but step 4 did not work, you might have to log out and in or you can even try to restart the machine. In my case the result was instant. If all of that did not work for you - sorry - but probably the above helps you to track your particular problem down.

ecke

PM G5 Dual 2 GHz      
Lee_SF

Posts: 4
From: San Francisco, CA
Registered: Nov 30, 2007
Re: Unable to Search Mailbox
Posted: Nov 30, 2007 4:05 PM   in response to: Ian Park
 

Make sure the directory containing Mail isn't marked as Private in Spotlight. I'd marked the entire drive as private from another boot volume, thinking the state was local to that copy of the OS, but it's apparently global. mdimport didn't give any errors when I ran it, just finished surprisingly quickly.

Now, on the other hand, it's running really slowly, so it must be doing something...

     
Peace Freak!


Posts: 105
Registered: Jul 21, 2002
Re: Unable to Search Mailbox
Posted: Feb 8, 2008 10:17 PM   in response to: Ben Harris
 

Hmmm... This index problem is bugging me too... Well, I did not find a second version of Mail on my hard disk. Anyway, I ran: mdimport ~/Library/Mail and got about 10 lines like this in the terminal:

2008-02-09 15:09:10.517 mdimport4937:807 *** Failed to decode quoted-printable data, treating as binary
2008-02-09 15:13:28.642 mdimport4937:807 *** Failed to decode 7bit data, treating as binary

Anyone got any ideas?

MacBook 2GHz   Mac OS X (10.4.8)   2 Gig Ram  
Jeff Vandehey


Posts: 38
Registered: Aug 15, 2002
Re: Unable to Search Mailbox
Posted: Feb 11, 2008 10:57 AM   in response to: Ian Park
 

Great post, I feel like I'm getting closer. I had mail.app on a 10.4 partition on my system, which I deleted. When I did the mdimport of my mail info, I got LOTS of errors. Like:

failed to parse embedded CMap.
syntax error, unexpected CMAPNAME, expecting DICTEND.

2008-02-11 10:39:36.161 mdimport54182:807 Unexpected EOF, returning last token as fallback

After hundreds of these errors, I still can't search 'entire message'. I have nothing in the 'privacy' tab of spotlight. It appears my whole volume index is screwed up. Spotlight won't find anything on my boot (10.5) volume. It does find files on my older 10.4 partition though.

I have deleted and rebuilt my index on 10.5 many times. Disabled then re-enabled spotlight. Still no help. Any ideas?

G4 Tower   Mac OS X (10.5.1)    
Jeff Vandehey


Posts: 38
Registered: Aug 15, 2002
Re: Unable to Search Mailbox
Posted: Feb 11, 2008 11:01 AM   in response to: Jeff Vandehey
 

I actually have gotten closer. When I use spotlight from the finder, it finds mail messages accurately! I'm excited about that. But, when I search from within Mail.app, 'entire message' returns no result.

MacPro   Mac OS X (10.5.1)    
DToffler

Posts: 4
From: Canada
Registered: Feb 24, 2008
Re: Unable to Search Mailbox
Posted: Feb 24, 2008 6:56 PM   in response to: Jeff Vandehey
 

After following this for a while and trying any number of approaches the only one that has worked ...so far.....was a clean install followed by a migration from the offending boot volume.

I did a clean install of Leopard then updated via Combo updater and then whatever other updates.

THEN used Migration manager to import.

For the first couple of tries there still seemed to be a problem then it corrected and both Spotlight and Mail searched and found contents of INBox properly.

We'll see if it holds.

2.8   Mac OS X (10.5.2)  
epá zug


Posts: 21
Registered: Jan 19, 2003
Re: Unable to Search Mailbox
Posted: Feb 27, 2008 9:10 PM   in response to: Ian Park
 

I've been having the same problems on and off, in addition to mail messages from the last month (since I upgraded from 10.4 to 10.5?) not showing up in spotlight searches in Mail.

I'd tried a few of the other solutions like adding the Mail dir to the Privacy tab in the Spotlight Sys Prefs and then taking it out, and using a 3rd party app SpotlightIndexer to force an an indexing of ~/Library/Mail, but neither of these worked.

Since when I delved in this directory the mboxes appeared as folders not packaged I tried the simpler:
mdimport ~/Library/Mail
first which after a few hours of running with the magnifying glass in the upper right of the menu bar showing it was processing seemed to do the trick! So I didn't have to resort to the more complicated
find ~/Library/Mail -name ".emlx" -exec mdimport {} \;*

Thanks for everyone's suggestions on this vexing issue!

G4 Sawtooth 1 GHz (Sonnet upgr