[PATCH 1/4] Mailstore abstraction interface

Michal Sojka sojkam1 at fel.cvut.cz
Wed Apr 14 01:50:44 PDT 2010


On Tue, 13 Apr 2010, Carl Worth wrote:
> On Thu,  8 Apr 2010 16:42:43 +0200, Michal Sojka <sojkam1 at fel.cvut.cz> wrote:
> > The goal of mailstore abstraction is to allow notmuch to store tags
> > together with email messages. The abstract interface is needed because
> > people want to use different ways of storing their emails. Currently,
> > there exists implementation for two types of mailstore - plain files
> > and maildir. It is expected that additional git-based mailstore will
> > be developed later.
> 
> I don't agree with the approach being taken here.
> 
> I don't think that the expectation of future need is a good basis for
> adding a level of abstraction now. This gives us current costs without
> benefit.

Thanks for the review, Carl. Since I'm interested in further development
of mailstore abstraction until it is really useful, I'd like to make the
patch series as small as possible to reduce maintenance burden. I think
I can extract some "real features" such as cat subcommand from my
patches and send them separately, perhaps in 0.3 merge window.

> Meanwhile, the two different mail stores that you are currently support
> ("plain" and "maildir") aren't really different types. We do already
> have code within notmuch to detect whether any particular directory is a
> maildir, (with the heuristic of looking for child directories named
> "cur", "new", and "tmp"). So I think we can and should support both
> maildir and non-maildir mail storage just fine.
> 
> The question of "once you have maildir storage, should you synchronize
> that tags" is quite separate. The answer there might be "yes", "no", or
> "let the user decide". But if it is configurable, then the configuration
> should be something like
> 
> 	[maildir]
> 	synchronize_flags=yes
> 
> rather than
> 
> 	[mailstore]
> 	type=maildir

Yes, these two mail stores share a lot of code and there is only a small
difference between them. I agree that it is cleaner for users to see
them as a single mailstore type and use configuration options to change
the behavior.

-Michal


More information about the notmuch mailing list