--- /dev/null
+Return-Path: <aclements@csail.mit.edu>\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 26664429E37\r
+ for <notmuch@notmuchmail.org>; Thu, 23 Oct 2014 05:31:07 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_MED=-2.3] 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 Vn1B6EnoXByo for <notmuch@notmuchmail.org>;\r
+ Thu, 23 Oct 2014 05:31:01 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-7.mit.edu (dmz-mailsec-scanner-7.mit.edu\r
+ [18.7.68.36])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id CF78B431FDD\r
+ for <notmuch@notmuchmail.org>; Thu, 23 Oct 2014 05:30:52 -0700 (PDT)\r
+X-AuditID: 12074424-f79346d000004923-06-5448f4fc4ba1\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+ (using TLS with cipher AES256-SHA (256/256 bits))\r
+ (Client did not present a certificate)\r
+ by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id AB.1C.18723.CF4F8445; Thu, 23 Oct 2014 08:30:52 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+ by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id s9NCUmgN027180; \r
+ Thu, 23 Oct 2014 08:30:48 -0400\r
+Received: from drake.dyndns.org\r
+ (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+ [216.15.114.40]) (authenticated bits=0)\r
+ (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+ by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s9NCUhqY008926\r
+ (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT);\r
+ Thu, 23 Oct 2014 08:30:47 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.84)\r
+ (envelope-from <aclements@csail.mit.edu>)\r
+ id 1XhHXP-0007bc-5W; Thu, 23 Oct 2014 08:30:43 -0400\r
+From: Austin Clements <aclements@csail.mit.edu>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 1/9] lib: Add a ghost messages database feature\r
+Date: Thu, 23 Oct 2014 08:30:33 -0400\r
+Message-Id: <1414067441-29054-2-git-send-email-aclements@csail.mit.edu>\r
+X-Mailer: git-send-email 2.1.0\r
+In-Reply-To: <1414067441-29054-1-git-send-email-aclements@csail.mit.edu>\r
+References: <1414067441-29054-1-git-send-email-aclements@csail.mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsUixG6novvni0eIwcbXahar5/JYXL85k9mB\r
+ yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgyljQ85Gt4AZXxfPzk1gbGBdwdDFyckgImEjs\r
+ mrWLCcIWk7hwbz1bFyMXh5DAbCaJln/fWCGcjYwSy1fcZYZw7jBJPJvwmwnCWcIocf7sK7B+\r
+ NgF9iRVrJ7GC2CIC0hI7784Gs5kFHCU+71/EBmILCzhJrPkxgR3EZhFQldi0+S5YL6+Au8Ti\r
+ NetZIe6Qk9iw+z8jiM0p4CGxZ8cdsF4hoJrtzw+yTmDkX8DIsIpRNiW3Sjc3MTOnODVZtzg5\r
+ MS8vtUjXXC83s0QvNaV0EyM4lFxUdjA2H1I6xCjAwajEw1uR7BEixJpYVlyZe4hRkoNJSZQ3\r
+ 5gFQiC8pP6UyI7E4I76oNCe1+BCjBAezkghv/AWgHG9KYmVValE+TEqag0VJnHfTD74QIYH0\r
+ xJLU7NTUgtQimKwMB4eSBC8jMGaEBItS01Mr0jJzShDSTBycIMN5gIbf+gwyvLggMbc4Mx0i\r
+ f4pRUUqcNxkkIQCSyCjNg+uFxforRnGgV4R5N4BU8QDTBFz3K6DBTCBXbwAbXJKIkJJqYAwK\r
+ S2O+9a3+SYsUm1X8bDOnnYev8z7jjmjWMWjmyWU3XS5qa3eZRXpFd56+9v4OnUlTJu5e9k+2\r
+ 8MCr3ppzPx9ftvk0vZvBaMf7hL36MbOi+f5dfXY6/4mI/FHv3Y9256d1xFUt5P5w7kz5S7+M\r
+ gG36PlLLZ0ZWlJ39odpksLrkbsSpn97JkUosxRmJhlrMRcWJALtMtkvQAgAA\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: Thu, 23 Oct 2014 12:31:07 -0000\r
+\r
+From: Austin Clements <amdragon@mit.edu>\r
+\r
+This will be implemented over the next several patches. The feature\r
+is not yet "enabled" (this does not add it to\r
+NOTMUCH_FEATURES_CURRENT).\r
+---\r
+ lib/database-private.h | 7 +++++++\r
+ lib/database.cc | 2 ++\r
+ 2 files changed, 9 insertions(+)\r
+\r
+diff --git a/lib/database-private.h b/lib/database-private.h\r
+index ca0751c..e2e4bc8 100644\r
+--- a/lib/database-private.h\r
++++ b/lib/database-private.h\r
+@@ -85,6 +85,13 @@ enum _notmuch_features {\r
+ *\r
+ * Introduced: version 2. */\r
+ NOTMUCH_FEATURE_BOOL_FOLDER = 1 << 3,\r
++\r
++ /* If set, missing messages are stored in ghost mail documents.\r
++ * If unset, thread IDs of ghost messages are stored as database\r
++ * metadata instead of in ghost documents.\r
++ *\r
++ * Introduced: version 3. */\r
++ NOTMUCH_FEATURE_GHOSTS = 1 << 4,\r
+ };\r
+ \r
+ /* In C++, a named enum is its own type, so define bitwise operators\r
+diff --git a/lib/database.cc b/lib/database.cc\r
+index 1c6ffc5..8fd7fad 100644\r
+--- a/lib/database.cc\r
++++ b/lib/database.cc\r
+@@ -286,6 +286,8 @@ static const struct {\r
+ "from/subject/message-ID in database", "w" },\r
+ { NOTMUCH_FEATURE_BOOL_FOLDER,\r
+ "exact folder:/path: search", "rw" },\r
++ { NOTMUCH_FEATURE_GHOSTS,\r
++ "mail documents for missing messages", "w"},\r
+ };\r
+ \r
+ const char *\r
+-- \r
+2.1.0\r
+\r