--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\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 515F26DE0A9A\r
+ for <notmuch@notmuchmail.org>; Fri, 11 Dec 2015 13:53:35 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.704\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.704 tagged_above=-999 required=5 tests=[AWL=0.052, \r
+ SPF_NEUTRAL=0.652] 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 l0tSiscu6P4Z for <notmuch@notmuchmail.org>;\r
+ Fri, 11 Dec 2015 13:53:33 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by arlo.cworth.org (Postfix) with ESMTP id CB3C76DE005F\r
+ for <notmuch@notmuchmail.org>; Fri, 11 Dec 2015 13:53:32 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id AF42310004A;\r
+ Fri, 11 Dec 2015 23:53:39 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,\r
+ Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH 1/9] reorganize indexing of multipart/signed and\r
+ multipart/encrypted\r
+In-Reply-To: <1449718786-28000-2-git-send-email-dkg@fifthhorseman.net>\r
+References: <1449718786-28000-1-git-send-email-dkg@fifthhorseman.net>\r
+ <1449718786-28000-2-git-send-email-dkg@fifthhorseman.net>\r
+User-Agent: Notmuch/0.21+32~g73439f8 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Fri, 11 Dec 2015 23:53:39 +0200\r
+Message-ID: <m2a8pg7iu4.fsf@guru.guru-group.fi>\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: Fri, 11 Dec 2015 21:53:35 -0000\r
+\r
+On Thu, Dec 10 2015, Daniel Kahn Gillmor <dkg@fifthhorseman.net> wrote:\r
+\r
+> This prepares the codebase for a cleaner changeset for dealing with\r
+> indexing some encrypted messages in the clear.\r
+> ---\r
+> lib/index.cc | 38 ++++++++++++++++++--------------------\r
+> 1 file changed, 18 insertions(+), 20 deletions(-)\r
+>\r
+> diff --git a/lib/index.cc b/lib/index.cc\r
+> index f166aef..2fa6616 100644\r
+> --- a/lib/index.cc\r
+> +++ b/lib/index.cc\r
+> @@ -333,27 +333,25 @@ _index_mime_part (notmuch_message_t *message,\r
+> GMimeMultipart *multipart = GMIME_MULTIPART (part);\r
+> int i;\r
+> \r
+> - if (GMIME_IS_MULTIPART_SIGNED (multipart))\r
+> - _notmuch_message_add_term (message, "tag", "signed");\r
+> -\r
+> - if (GMIME_IS_MULTIPART_ENCRYPTED (multipart))\r
+> - _notmuch_message_add_term (message, "tag", "encrypted");\r
+> -\r
+> - for (i = 0; i < g_mime_multipart_get_count (multipart); i++) {\r
+> - if (GMIME_IS_MULTIPART_SIGNED (multipart)) {\r
+> - /* Don't index the signature. */\r
+> - if (i == 1)\r
+> - continue;\r
+> - if (i > 1)\r
+> - _notmuch_database_log (_notmuch_message_database (message),\r
+> - "Warning: Unexpected extra parts of multipart/signed. Indexing anyway.\n");\r
+> - }\r
+> - if (GMIME_IS_MULTIPART_ENCRYPTED (multipart)) {\r
+> - /* Don't index encrypted parts. */\r
+> - continue;\r
+> - }\r
+> + if (GMIME_IS_MULTIPART_SIGNED (multipart)) {\r
+> + _notmuch_message_add_term (message, "tag", "signed");\r
+> + /* FIXME: should we try to validate the signature? */\r
+> + \r
+> + /* FIXME: is it always just the first part that is signed in\r
+> + all multipart/signed messages?*/\r
+> _index_mime_part (message,\r
+> - g_mime_multipart_get_part (multipart, i));\r
+> + g_mime_multipart_get_part (multipart, 0));\r
+> + \r
+> + if (g_mime_multipart_get_count (multipart) > 2)\r
+> + _notmuch_database_log (_notmuch_message_database (message),\r
+> + "Warning: Unexpected extra parts of multipart/signed. Indexing anyway.\n");\r
+> + } else if (GMIME_IS_MULTIPART_ENCRYPTED (multipart)) {\r
+> + /* Don't index encrypted parts */\r
+\r
+This could have the _notmuch_message_add_term (message, "tag", "encrypted");\r
+that was added in next patch file ?\r
+\r
+(i saw your latest proposal, here i am commenting so that the relevant\r
+changes can be done in nest round...)\r
+\r
+\r
+> + } else {\r
+> + for (i = 0; i < g_mime_multipart_get_count (multipart); i++) {\r
+> + _index_mime_part (message,\r
+> + g_mime_multipart_get_part (multipart, i));\r
+> + }\r
+> }\r
+> return;\r
+> }\r
+> -- \r
+> 2.6.2\r