--- /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 19FA7431FBD\r
+ for <notmuch@notmuchmail.org>; Mon, 6 Oct 2014 16:17:42 -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 EqaH5XIUva2q for <notmuch@notmuchmail.org>;\r
+ Mon, 6 Oct 2014 16:17:37 -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 4ABCE431FC0\r
+ for <notmuch@notmuchmail.org>; Mon, 6 Oct 2014 16:17:30 -0700 (PDT)\r
+X-AuditID: 12074424-f79346d000004923-42-54332309121f\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\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 C6.B5.18723.A0323345; Mon, 6 Oct 2014 19:17:30 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+ by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id s96NHTmr030747; \r
+ Mon, 6 Oct 2014 19:17:29 -0400\r
+Received: from drake.dyndns.org ([12.185.136.2]) (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 s96NHRuR014548\r
+ (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT);\r
+ Mon, 6 Oct 2014 19:17:28 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.84)\r
+ (envelope-from <aclements@csail.mit.edu>)\r
+ id 1XbHWr-0001JU-Pr; Mon, 06 Oct 2014 17:17:21 -0600\r
+From: Austin Clements <aclements@csail.mit.edu>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 04/12] lib: Add a ghost messages database feature\r
+Date: Mon, 6 Oct 2014 17:17:10 -0600\r
+Message-Id: <1412637438-4821-5-git-send-email-aclements@csail.mit.edu>\r
+X-Mailer: git-send-email 2.1.0\r
+In-Reply-To: <1412637438-4821-1-git-send-email-aclements@csail.mit.edu>\r
+References: <1412637438-4821-1-git-send-email-aclements@csail.mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrHIsWRmVeSWpSXmKPExsUixCmqrculbBxi8KGF1eJGazejxfWbM5kd\r
+ mDyerbrF7LHl0HvmAKYoLpuU1JzMstQifbsErowFPR/ZCm5wVTw/P4m1gXEBRxcjJ4eEgIlE\r
+ 3+edbBC2mMSFe+uBbC4OIYHZTBJnZt+BcjYwSqzcs5YJwlnKJNF+eh0jhLOEUaJn6zxGkH42\r
+ AX2JFWsnsYLYIgLSEjvvzgazmQUsJa5+bWcCsYUFXCRmv1rIDmKzCKhKLL+wGszmFXCT6P/y\r
+ gAXiDjmJDbv/g83kFHCXWHNlMtgcIaCa5z+fskxg5F/AyLCKUTYlt0o3NzEzpzg1Wbc4OTEv\r
+ L7VI11wvN7NELzWldBMjKJjYXVR2MDYfUjrEKMDBqMTDG7HDMESINbGsuDL3EKMkB5OSKO8c\r
+ duMQIb6k/JTKjMTijPii0pzU4kOMEhzMSiK8XL+NQoR4UxIrq1KL8mFS0hwsSuK8m37whQgJ\r
+ pCeWpGanphakFsFkZTg4lCR4OxSBhgoWpaanVqRl5pQgpJk4OEGG8wANPwRSw1tckJhbnJkO\r
+ kT/FqCglzhsMkhAASWSU5sH1wqL9FaM40CvCvPNBqniAiQKu+xXQYCagwaZz9EEGlyQipKQa\r
+ GCOyZk2TPfnXLq9dLsClNfoRk+hPs17HT/OnKFx5kHlKZsJFhh/9IVt/fk95/vTtmu0W/qVH\r
+ /62a8LE4UqD+1Oetz2KaLi/0nnguTeFBfBi7zEWG5Q/N5P14rsqU/Q376/wkdpn3y70NDBeE\r
+ 20TvC56dEun68pXMya2OLFGR1esSIzfcMPvG+VeJpTgj0VCLuag4EQCJ7q980QIAAA==\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, 06 Oct 2014 23:17:42 -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