[notmuch] Introducing notmuchsync

Ben Gamari bgamari at gmail.com
Mon Mar 1 10:43:24 PST 2010


Excerpts from Michal Sojka's message of Mon Mar 01 12:18:55 -0500 2010:
> > Is this really necessary? Another option (which I believe has been
> > mentioned here in the past) is to simply pass notmuch new a list of
> > message "paths" to add (although I'm not sure if many mail delivery
> > programs give you that sort of information). 
> 
> This could also be possible, but now, you say "notmuch new" and notmuch
> itself figure out what to index. If passing notmuch a list on files to
> index will be the only supported way, it might be hard for new users to
> start with notmuch. A nice thing on notmuch is that it can be used
> almost without any configuration.

It seems like a script in contrib/ would suffice.

> 
> > How do you propose that the backends keep track of what mail has been
> > indexed?
> 
> For example by using Xapian metadata:
> notmuch->xapian_db->set_metadata ("git-head", sha1);

However, this means that the backend would need to know about the
indexing database, which seems to me like a implementation detail that
should be hidden from the backend (perhaps? Maybe not, I suppose). I guess this all
depends upon how much we want to abstract out the backends.

> 
> > > Now, if we have this, it would be very easy to add support for
> > > Maildir-based mail-store. The implementation of the first two methods
> > > would be the same as what is currently in notmuch and the third method
> > > would rename files in mailstore if certain tags (such as unread) are
> > > added or removed. In case of rename, notmuch database would be
> > > immediately updated to reflect the change.
> > > 
> > The interface here seems a little vague. How would the backend notify
> > notmuch that the filename has changed?
> 
> notmuch new
> 
> The idea is that tags changed by notmuch are stored immediately (and
> database is updated accordingly), whereas when the mail store is changed
> by an external tool, you must explicitly ask notmuch to notice that.
> 
Certainly, I understand that and believe that that is the only sane
approach. However, you currently have no mechanism in your interface to
allow the backend to notify notmuch that the file name has changed.
Considering this is the sole value identifying the message to notmuch,
you definitely need to tell notmuch about the change.

> > Don't forget mbox. It seems like it would be pretty trivial to
> > implement (although I'm not sure what performance would look like).
> 
> I personally do not use mboxes, so I'm not interested in them.

Fair enough. Just figured it wouldn't be too difficult (although I know
very little about the format).

> > With all of this infrastructure, it seems like it wouldn't be too
> > difficult to support messages from multiple backends in a single index.
> > Not sure if people would be interested enough to warrant the added
> > complexity though.
> 
> I'm currently not interested in such a functionality, but we can add it
> later if there is a need.

Certainly. Just throwing out ideas. 

- Ben


More information about the notmuch mailing list