Spotlight plugin for MailSpool


This is a Spotlight plugin for the mail folder of MH or Gnus nnml backend. It extracts metadata from numbered files under Mail directory, and imports the metadata into Spotlight database.

It uses Ruby interpreter to extract metadata. So you can easily customize the extraction to edit GetMetadataForFile.rb file. But processing is slightly heavy because of Ruby.

To parse mails, it includes TMail library. To parse HTML mails, it includes ymHTML library.

Version 0.1.4u supports Universal Binary. It will work on Intel Mac (2008-01-06).



Copy MailSpool.mdimporter to ~/Library/Spotlight/.


Plugin setup

  ## list plugins
  $ mdimport -L

  ## test extraction
  $ mdimport -d2 -n ~/Mail/test/

  ## import
  $ mdimport ~/Mail/test/

  ## list metadata
  $ mdls ~/Mail/test/1

  ## test to search
  $ mdfind -onlyin ~/Mail/ 'kMDItemTitle == "Test*"'

Gnus setup

(require 'gnus-spotlight)

Key bindings

\C-c\C-n    gnus-spotlight-search

\C-c\C-n    gnus-spotlight-search

Keyword completion

Search words can be completed by <TAB> key.


TMail is under LGPL´╝îand the other parts of plugin are under Ruby license.

gnus-spotlight.el is under GPL.

Last modified: Sun Jan 6 23:14:23 JST 2008
Yoshida Masato <>