--- /dev/null
+Return-Path: <gmn-notmuch@m.gmane.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 063C0431FBD\r
+ for <notmuch@notmuchmail.org>; Mon, 21 Jul 2014 16:05:37 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id yVd8jKPG4l9B for <notmuch@notmuchmail.org>;\r
+ Mon, 21 Jul 2014 16:05:31 -0700 (PDT)\r
+Received: from plane.gmane.org (plane.gmane.org [80.91.229.3])\r
+ (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 61F22431FAE\r
+ for <notmuch@notmuchmail.org>; Mon, 21 Jul 2014 16:05:31 -0700 (PDT)\r
+Received: from list by plane.gmane.org with local (Exim 4.69)\r
+ (envelope-from <gmn-notmuch@m.gmane.org>) id 1X9Me7-0001HG-Pz\r
+ for notmuch@notmuchmail.org; Tue, 22 Jul 2014 01:05:27 +0200\r
+Received: from ip68-100-203-36.dc.dc.cox.net ([68.100.203.36])\r
+ by main.gmane.org with esmtp (Gmexim 0.1 (Debian))\r
+ id 1AlnuQ-0007hv-00\r
+ for <notmuch@notmuchmail.org>; Tue, 22 Jul 2014 01:05:27 +0200\r
+Received: from mvoteiza by ip68-100-203-36.dc.dc.cox.net with local (Gmexim\r
+ 0.1 (Debian)) id 1AlnuQ-0007hv-00\r
+ for <notmuch@notmuchmail.org>; Tue, 22 Jul 2014 01:05:27 +0200\r
+X-Injected-Via-Gmane: http://gmane.org/\r
+To: notmuch@notmuchmail.org\r
+From: Mark Oteiza <mvoteiza@udel.edu>\r
+Subject: [PATCH] config: read database.path from $MAILDIR if set\r
+Date: Mon, 21 Jul 2014 19:05:12 -0400\r
+Lines: 44\r
+Message-ID: <87ha2axqhj.fsf@holos.localdomain>\r
+Mime-Version: 1.0\r
+Content-Type: text/plain\r
+X-Complaints-To: usenet@ger.gmane.org\r
+X-Gmane-NNTP-Posting-Host: ip68-100-203-36.dc.dc.cox.net\r
+User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)\r
+Cancel-Lock: sha1:tX6Aitr2+MsK2fejcqcXjvwc33E=\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 21 Jul 2014 23:05:37 -0000\r
+\r
+\r
+Try to read the config parameter database.path from $MAILDIR before\r
+falling back to $HOME/mail\r
+---\r
+In the same vein as the $NAME patch, it would also be nice to configure\r
+the maildir location for notmuch with one's environment. Just from a\r
+brief perusing, I see that $MAILDIR is used at least by Gnus, procmail,\r
+GNU mailutils, and mutt.\r
+\r
+Another thing that might be nice is tilde expantion for database.path,\r
+but that's more complicated :)\r
+\r
+ notmuch-config.c | 8 +++++---\r
+ 1 file changed, 5 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/notmuch-config.c b/notmuch-config.c\r
+index 8f1f48d..88831e2 100644\r
+--- a/notmuch-config.c\r
++++ b/notmuch-config.c\r
+@@ -217,7 +217,7 @@ get_username_from_passwd_file (void *ctx)\r
+ * These default configuration settings are determined as\r
+ * follows:\r
+ *\r
+- * database_path: $HOME/mail\r
++ * database_path: $MAILDIR, otherwise $HOME/mail\r
+ *\r
+ * user_name: $NAME variable if set, otherwise\r
+ * read from /etc/passwd\r
+@@ -323,8 +323,10 @@ notmuch_config_open (void *ctx,\r
+ \r
+ \r
+ if (notmuch_config_get_database_path (config) == NULL) {\r
+- char *path = talloc_asprintf (config, "%s/mail",\r
+- getenv ("HOME"));\r
++ char *path = getenv ("MAILDIR");\r
++ if (! path)\r
++ path = talloc_asprintf (config, "%s/mail",\r
++ getenv ("HOME"));\r
+ notmuch_config_set_database_path (config, path);\r
+ talloc_free (path);\r
+ }\r
+-- \r
+2.0.2\r
+\r
+\r