On Apr 16, 2013 at 02:17 PM -0600, Kyle Wheeler wrote:
You can do the following:

   find /path/to/maildir -type f -exec /Developer/Tools/SetFile -t TEXT {} \;

Thanks for the link. I actually found this earlier today. What this does I believe is sets the file type, which I thought was deprecated (though still functional). I was not able to find a 'mail' file type which the spotlight importer correctly interprets.

Regardless, Spotlight actually already will index the messages in a maildir. I forgot to mention that. The issue is that they show up as 'documents' and not 'mail', and as a result, the formatting is poor (all the headers are displayed) as well as not having additional useful attributes defined, like sender, recipient, subject, etc. However, if one wanted to go down that route, there is a quicklook plugin which will display any file:

https://github.com/whomwah/qlstephen

I suspect you can do something similar to identify them as mail files, but I don't have a Mac in front of me to play around with it.

I hope you are correct. I have my doubts though. As I understand it, it's all controlled by UTIs, which are primarily set through the file extension. I believe there can also refer to file type codes (as discussed above) and MIME types. The latter might be the way to go, but I'm not sure if OS X properly recognizes the MIME type of an eml file in a manner that Spotlight can use.

That done, you now have the problem that you have to re-execute that set of commands periodically to keep the Spotlight database updated.

Or, just stick an extension on the file name. I really do think that might be the path of least resistance.

Reply via email to