techblog @ razal.de


get back | techblog | get rss

Tue, 10 Jul 2007

thunderbird and spotlight

a friend of mine told me that thunderbird 2 supposedly supports os x spotlight feature. so i did a google search and found a few instructions here (german) on how to get it up and running.

first: you need to get the spotlight importer from this bugreport (download attachment from comment #109) and put it in ~/Library/Spotlight/ or /Library/Spotlight/ (create if necessary).

second: in thunderbird preferences go to config editor (tab advanced) and set mail.spotlight.enable to true. thunderbird needs to be restarted after this. then it begins to index all mails (this will take a while), which effectively means that it generates a .mozeml file for spotlight for each mail in your mailbox. this is because thunderbird saves it's mails internally as mbox files which are unsuitable for spotlight.

third: check with /usr/bin/mdimport -L if the thunderbird importer was found and reindex your spotlight database with sudo /usr/bin/mdutil -E /. (i don't know if a reboot is necessary)

[update]
there was one little drawback with the importer as noted here. messages showed in category Documents rather then Mail messages. but with help from the spotlight-dev mailing list i found a solution.
you need to edit Info.plist located in Thunderbird.mdimporter (ctrl-click -> Show Package Contents). you can use any editor you like but the safest bet is to use the Property List Editor (i killed my Info.plist with TextEdit!).
  <key>UTTypeConformsTo</key>
  <array>
    <string>public.data</string>
    <string>public.content</string>
    <string>public.email-message</string> <-- add this line
  </array>
i don't know how to convince spotlight to reload its plugins so reboot please. reindex your spotlight now.

to check if everything went alright locate a .mozeml file (usually under ~/Library/Thunderbird/Profiles/...) and call mdls with it. you are good to go if anything like this shows up.
kMDItemContentType             = "com.mozilla.thunderbird.mozeml"
kMDItemContentTypeTree         = (
    "com.mozilla.thunderbird.mozeml", 
    "public.data", 
    "public.item", 
    "public.content", 
    "public.email-message", 
    "public.message"
)
screenshot

[update 2]
KAMiKAZOW has build a new version (universal binary) of Thunderbird.mdimporter incorporating the Info.plist change and attached it to the bugreport. so no more Info.plist editing.

[update 3]
from the amount of 19k mails 10k have been converted. 9k to go. took a day so far...

posted at: 16:05 | path: /mac
tags: , ,