From 130e5e4a79d7a1d243d695b5c9a1e0c5d18c8920 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 28 Feb 2016 09:14:44 +2000 Subject: [PATCH] Re: [PATCH v3 08/16] reorganize indexing of multipart/signed and multipart/encrypted --- d9/9b6a1ab54c7bc03cef5d09f14116df68467317 | 101 ++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 d9/9b6a1ab54c7bc03cef5d09f14116df68467317 diff --git a/d9/9b6a1ab54c7bc03cef5d09f14116df68467317 b/d9/9b6a1ab54c7bc03cef5d09f14116df68467317 new file mode 100644 index 000000000..a1f6f32ad --- /dev/null +++ b/d9/9b6a1ab54c7bc03cef5d09f14116df68467317 @@ -0,0 +1,101 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id B1C156DE17E3 + for ; Sat, 27 Feb 2016 05:14:49 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.036 +X-Spam-Level: +X-Spam-Status: No, score=-0.036 tagged_above=-999 required=5 + tests=[AWL=-0.025, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] + autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id c0SvlHGR4cxy for ; + Sat, 27 Feb 2016 05:14:47 -0800 (PST) +Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) + by arlo.cworth.org (Postfix) with ESMTPS id 16F816DE12E8 + for ; Sat, 27 Feb 2016 05:14:47 -0800 (PST) +Received: from remotemail by fethera.tethera.net with local (Exim 4.84) + (envelope-from ) + id 1aZeiU-0006kF-Ky; Sat, 27 Feb 2016 08:15:26 -0500 +Received: (nullmailer pid 3361 invoked by uid 1000); + Sat, 27 Feb 2016 13:14:44 -0000 +From: David Bremner +To: Daniel Kahn Gillmor , + Notmuch Mail +Subject: Re: [PATCH v3 08/16] reorganize indexing of multipart/signed and + multipart/encrypted +In-Reply-To: <1454272801-23623-9-git-send-email-dkg@fifthhorseman.net> +References: <1454272801-23623-1-git-send-email-dkg@fifthhorseman.net> + <1454272801-23623-9-git-send-email-dkg@fifthhorseman.net> +User-Agent: Notmuch/0.21+26~g9404723 (http://notmuchmail.org) Emacs/24.5.1 + (x86_64-pc-linux-gnu) +Date: Sat, 27 Feb 2016 09:14:44 -0400 +Message-ID: <871t7y5m7v.fsf@zancas.localnet> +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 27 Feb 2016 13:14:49 -0000 + +Daniel Kahn Gillmor writes: + +> This prepares the codebase for a cleaner changeset for dealing with +> indexing some encrypted messages in the clear. +> --- +> lib/index.cc | 39 +++++++++++++++++++-------------------- +> 1 file changed, 19 insertions(+), 20 deletions(-) +> +> diff --git a/lib/index.cc b/lib/index.cc +> index f166aef..ab0fd78 100644 +> --- a/lib/index.cc +> +++ b/lib/index.cc +> @@ -333,27 +333,26 @@ _index_mime_part (notmuch_message_t *message, +> GMimeMultipart *multipart = GMIME_MULTIPART (part); +> int i; +> +> - if (GMIME_IS_MULTIPART_SIGNED (multipart)) +> - _notmuch_message_add_term (message, "tag", "signed"); +> - +> - if (GMIME_IS_MULTIPART_ENCRYPTED (multipart)) +> - _notmuch_message_add_term (message, "tag", "encrypted"); +> - +> - for (i = 0; i < g_mime_multipart_get_count (multipart); i++) { +> - if (GMIME_IS_MULTIPART_SIGNED (multipart)) { +> - /* Don't index the signature. */ +> - if (i == 1) +> - continue; +> - if (i > 1) +> - _notmuch_database_log (_notmuch_message_database (message), +> - "Warning: Unexpected extra parts of multipart/signed. Indexing anyway.\n"); +> - } +> - if (GMIME_IS_MULTIPART_ENCRYPTED (multipart)) { +> - /* Don't index encrypted parts. */ +> - continue; +> - } +> + if (GMIME_IS_MULTIPART_SIGNED (multipart)) { +> + _notmuch_message_add_term (message, "tag", "signed"); +> + /* FIXME: should we try to validate the signature? */ +> + +> + /* FIXME: is it always just the first part that is signed in +> + all multipart/signed messages?*/ +> _index_mime_part (message, +> - g_mime_multipart_get_part (multipart, i)); +> + g_mime_multipart_get_part (multipart, 0)); + +It took me a long moment to understand the change from "index part if not 1" +to "index part 0". If that deserved explanation (which I'm not so certain +about), it would be in the commit message. -- 2.26.2