From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id D94DF6DE098B for ; Tue, 2 Jan 2018 16:00:38 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[AWL=0.011, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PfhHwDXmjM8m for ; Tue, 2 Jan 2018 16:00:37 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 936B26DE0243 for ; Tue, 2 Jan 2018 16:00:37 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1eWWTy-0004TV-Tu; Tue, 02 Jan 2018 19:00:34 -0500 Received: (nullmailer pid 7209 invoked by uid 1000); Wed, 03 Jan 2018 00:00:33 -0000 From: David Bremner To: Daniel Kahn Gillmor , notmuch@notmuchmail.org Subject: Re: [PATCH] WIP: support XDG database directory In-Reply-To: <877eszg8fv.fsf@fifthhorseman.net> References: <20171230200740.22509-1-david@tethera.net> <877eszg8fv.fsf@fifthhorseman.net> Date: Tue, 02 Jan 2018 20:00:33 -0400 Message-ID: <87a7xv3j6m.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jan 2018 00:00:39 -0000 Daniel Kahn Gillmor writes: > On Sat 2017-12-30 16:07:40 -0400, David Bremner wrote: > >> Just a rebase against current master, based on discussion in IRC >> today. AFAIK, the general approach could be extended to support a >> "NOTMUCH_DATABASE_DIRECTORY" environment variable, which if think is >> what Tomi was suggesting previously. > > I'm not sure i understand the rationale here -- it looks like this might > move the notmuch database directory away from its historic location > alongside the set of maildirs (then "mailstore"). is that right? > Correct. This is an often reguested feature. > where would each such notmuch database live if there were two different > mailstores? how is any given mailstore bound to the associated notmuch > database itself? Each database would point to the associated maildir_root in this version. > does the user point explicitly to both the mailstore > and the database? at the library level, I'm thinking the right API is probably to take both parameters (database and maildir), and if - database_path is NULL => look in traditional .notmuch location current notmuch_database_open would call something like notmuch_database_open2 (maildir, NULL). Presumable with a more informative name. - maildir_path is NULL => look in the database for a configuration - both are NULL => look in $ENV{NOTMUCH_DATABASE_DIRECTORY} and then under $ENV{XDG_DATA_HOME}/notmuch, using the database to find the maildir (essentially this patch) This last case is aimed at allowing users of the library to open a "default" database without the current parsing of .notmuch-config > is it possible (or should it be) to have one mailstore that is indexed > by multiple databases? Yes, this would possible, at least in terms of switching databases associated with a maildir. It doesn't cost extra implimentation effort. Whether it's a good thing or not, I don't know. As I write this I'm reminded that Xapian can search across multiple databases. I'm not sure if that's worth thinking about here. > i ask because i've been thinking about ways to protect the index itself, > but i want to make sure i understand all the different ways that the > mailstore and the database are (or are not) coupled to each other. I guess the initial proposal would be not at all? That probably allows a few new kinds of user error; I'm imagining runing notmuch new with mismatched database and maildir, and happily deleteing all of the database documents. d