A problem and a suggestion

Michal Sojka sojkam1 at fel.cvut.cz
Sun Aug 8 06:52:49 PDT 2010


On Fri, 06 Aug 2010, Stephen Paul Weber wrote:
> Anyway.  I installed notmuch a few days ago (0.1), ran the setup, ran
> notmuch new and i said it found 30000+ files, but no new mail?  No searches
> return any results.  What am I doing wrong?

Hi Stephen,

I guess you have your mails in a wrong fomrat. Do you see "Note:
Ignoring non-mail file" messages during notmuch new? You may also try
notmuch new --verbose.

> How does notmuch determine which mail is "new" anyway? 

New is a message found on your disk with a message-id not stored in
notmuch database.

> I gather by other threads on the list archives that editing a message
> does not make it "new"? So notmuch just gets whatever the first
> version of the message contents it sees is? And if the file gets
> renamed (by mutt for example, when marked as read) the filename stored
> by notmuch would then be wrong?

Yes. AFAIK notmuch assumes that messages are immutable and when you edit
the message, notmuch doesn't re-index it. Notmuch new code is able to
detect renames so if you rename the file, the filename in the database
is wrong only until you run notmuch new again.

> I'd also like to suggest that notmuch index the Keywords header, since that
> is a header meant exactly for being indexed by search engines and for
> searching on.  I use it quite a bit.

This is an often requested feature - everyone has its favorite header
which he wants to index. Indexing custom headers is planned for some
future release, but no code has appeared yet.

> This would be especially useful if notmuch re-indexed a message when I
> edit this header.

I'm not sure how hard it would be to implement this and what would be
the performance implications. You should store modification time of a
message in the database and re-index the file when the mtime on disk in
newer than in the database.
> 
> Actually, how hard would it be to allow notmuch to be configured to index
> any custom header?

Not much :-)

-Michal


More information about the notmuch mailing list