--- /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 2B2346DE00F5\r
+ for <notmuch@notmuchmail.org>; Thu, 14 Jul 2016 06:59:31 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.011\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.011 tagged_above=-999 required=5 tests=[AWL=0.000,\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 cpx5awkS2bQF for <notmuch@notmuchmail.org>;\r
+ Thu, 14 Jul 2016 06:59:23 -0700 (PDT)\r
+Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 5F8806DE00C9\r
+ for <notmuch@notmuchmail.org>; Thu, 14 Jul 2016 06:59:23 -0700 (PDT)\r
+Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
+ (envelope-from <david@tethera.net>)\r
+ id 1bNhAF-0003Em-TD; Thu, 14 Jul 2016 09:58:55 -0400\r
+Received: (nullmailer pid 5991 invoked by uid 1000);\r
+ Thu, 14 Jul 2016 13:59:15 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,\r
+ Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH v4 09/16] index encrypted parts when asked.\r
+In-Reply-To: <1467970047-8013-10-git-send-email-dkg@fifthhorseman.net>\r
+References: <1467970047-8013-1-git-send-email-dkg@fifthhorseman.net>\r
+ <1467970047-8013-10-git-send-email-dkg@fifthhorseman.net>\r
+User-Agent: Notmuch/0.22+28~gb9bf3f4 (http://notmuchmail.org) Emacs/24.5.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Thu, 14 Jul 2016 10:59:15 -0300\r
+Message-ID: <87lh14e2x8.fsf@tesseract.cs.unb.ca>\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: Thu, 14 Jul 2016 13:59:31 -0000\r
+\r
+Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:\r
+\r
+> + status = _notmuch_crypto_get_gmime_ctx_for_protocol (&(indexopts->crypto),\r
+> + protocol, &crypto_ctx);\r
+> + if (status) {\r
+> + _notmuch_database_log (notmuch, "Warning: setup failed for decrypting "\r
+> + "during indexing. (%d)\n", status);\r
+> + status = notmuch_message_add_property (message, "index-decryption", "failure");\r
+> + if (status)\r
+> + _notmuch_database_log (notmuch, "failed to add index-decryption "\r
+> + "property (%d)\n", status);\r
+> + return;\r
+> + }\r
+\r
+Currently the only correct usage of _notmuch_database_log is the\r
+following pattern\r
+\r
+ _notmuch_database_log (notmuch, "Cannot write to a read-only database.\n");\r
+ return NOTMUCH_STATUS_READ_ONLY_DATABASE;\r
+\r
+In particular, the log buffer is only one line, and the caller needs to\r
+know to retrieve it.\r
+\r
+I agree it's not ideal, but I doubt you want to delay your stuff in\r
+order to extend/fix the internal logging API.\r
+\r
+\r
+d\r