--- /dev/null
+Return-Path: <david@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 8E4356DE0032\r
+ for <notmuch@notmuchmail.org>; Sat, 19 Mar 2016 13:19:23 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.03\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.03 tagged_above=-999 required=5 tests=[AWL=-0.019,\r
+ SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id TMRZDSUT7t-n for <notmuch@notmuchmail.org>;\r
+ Sat, 19 Mar 2016 13:19:14 -0700 (PDT)\r
+Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 7FB956DE0008\r
+ for <notmuch@notmuchmail.org>; Sat, 19 Mar 2016 13:19:14 -0700 (PDT)\r
+Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
+ (envelope-from <david@tethera.net>)\r
+ id 1ahNLf-0006C5-M6; Sat, 19 Mar 2016 16:19:47 -0400\r
+Received: (nullmailer pid 31598 invoked by uid 1000);\r
+ Sat, 19 Mar 2016 20:19:09 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 6/6] WIP: support XDG database directory\r
+In-Reply-To: <m2k2l56iiu.fsf@guru.guru-group.fi>\r
+References: <1453561198-2893-1-git-send-email-david@tethera.net>\r
+ <1457785890-17058-1-git-send-email-david@tethera.net>\r
+ <1457785890-17058-7-git-send-email-david@tethera.net>\r
+ <m2k2l56iiu.fsf@guru.guru-group.fi>\r
+User-Agent: Notmuch/0.21+74~g6c60fb1 (http://notmuchmail.org) Emacs/24.5.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sat, 19 Mar 2016 17:19:09 -0300\r
+Message-ID: <8737rm2pc2.fsf@zancas.localnet>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 19 Mar 2016 20:19:23 -0000\r
+\r
+Tomi Ollila <tomi.ollila@iki.fi> writes:\r
+\r
+> This is good opening for (eventually "fixing" e.g. library interface...);\r
+> in its current state I can come up 2 (easily solvable) problems\r
+>\r
+> 1) the xapian database holding email indexes can grow to be quite large;\r
+> user may have large space for emails (somewhere else than HOME) but small\r
+> HOME. This can be "fixed" by keeping the database still in the same hierarchy\r
+> as email files. Making user to point XDG_DATA_HOME elsewhere is (I) global\r
+> and (II) fragile for an user to do.\r
+\r
+Sure, once we find the database, the mail tree can be anywhere,\r
+including the same place. The question is how do non-CLI clients find\r
+the database. I agree that setting XDG_DATA_HOME just for notmuch sounds\r
+ick. As you mention below we can fairly easily have our own environment\r
+variable (NOTMUCH_DATABASE ?) that is checked in preference to XDG_DATA_HOME.\r
+\r
+> 2) User may have multiple separate email configurations under one user\r
+> account; This is easy to fix with environment variable; if exists,\r
+> overrides XDG_DATA_HOME or $HOME/.local/share -- actually if this holds\r
+> "only" configurations, the XDG_CONFIG_HOME is more appropriate\r
+> (again, in simple case users should not be bothered to set any environment\r
+> variables themselves, but should be able to survive with large databases).\r
+\r
+For me, having an environment variable makes sense in terms of getting\r
+various tools (scripts etc...) to cooperate. For multiple databases,\r
+this seems less natural but of course the tools can still take some\r
+parameter specifying a database. Also, I don't know how common it is for\r
+people to have multiple databases.\r
+\r
+d\r