Skip to content

kawabata/nnir-spotlight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Spotlight Interface for Gnus nnir Method.

This file provides a Gnus nnir interface for MacOS Spotlight. As of it, you need MacOS X and Spotlight enabled. You can use it with `nnmh’, `nnml’, and `nnmaildir’ (offlineimap, procmail) methods.

MailSpool Importer Setup

You may need to install the MailSpool importer, which can create appropriate metadata from individual mail spool file. It can be downloaded from http://www.yoshidam.net/diary/Spotlight/.

% cp -pr MailSpool.mdimporter ~/Library/Spotlight/
% mdimport -L                  # see if the importer is recognized
% mdimport -d2 -n ~/Mail/test  # see if the importer appropriately works.
% mdimport ~/Mail              # import!
% mdls ~/Mail/test/1           # see if appropriate metadata are created.

Emacs Setup

You should choose the methods to be used with Spotlight.

(require 'nnir-spotlight)
(setq nnir-method-default-engines
       '((nnmaildir . spotlight)
         (nnml . spotlight)
         (nntp . gmane)))

If you are using `nnml’, specifying mail directory may be sufficient. Make sure that the prefix ends with “/”.

;; nnml/nnmh
(setq gnus-select-method '(nnml ""))
(setq nnir-spotlight-prefix "/home/john/Mail/")

or

(setq gnus-select-method '(nnml "" (nnir-spotlight-prefix "/home/john/Mail/")))

or

;; nnmaildir
(setq gnus-select-method '(nnmaildir "" (directory "~/Maildir")))

If `directory’ attribute is specified, it will be used for prefix. Otherwise, `nnir-spotlight-prefix’ will be used.

Query Format

In `gnus-group-make-nnir-group’ query, you can use the `mdfind’ query syntax. They can be parenthesized to make a complex searching.

kMDItemTitle ==
Mail Subject
kMDItemAuthorEmailAddresses ==
Email author addresses
kMDItemAuthors ==
Email author
kMDItemRecipientEmailAddresses ==
Email recipients addresses
kMDItemRecipients ==
Email recipients
kMDItemContentCreationDate
email date

For example, the the following query searches for the mail which contains foobar in title and sent within three days, containing either foo or bar in content.

kMDItemTitle == "*foobar*" && kMDItemContentCreationDate >= $time.today(-3) && (foo || bar)

About

Gnus nnir interface for MacOS X Spotlight

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published