From: Tomi Ollila Date: Fri, 11 Dec 2015 21:53:39 +0000 (+0200) Subject: Re: [PATCH 1/9] reorganize indexing of multipart/signed and multipart/encrypted X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0c61d3842d91ec7943cc3d65824aa90fb2178d76;p=notmuch-archives.git Re: [PATCH 1/9] reorganize indexing of multipart/signed and multipart/encrypted --- diff --git a/d2/a4310bbb6dec027ad46f439d2b76b06c0bebe9 b/d2/a4310bbb6dec027ad46f439d2b76b06c0bebe9 new file mode 100644 index 000000000..7c078b6f5 --- /dev/null +++ b/d2/a4310bbb6dec027ad46f439d2b76b06c0bebe9 @@ -0,0 +1,121 @@ +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 515F26DE0A9A + for ; Fri, 11 Dec 2015 13:53:35 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.704 +X-Spam-Level: +X-Spam-Status: No, score=0.704 tagged_above=-999 required=5 tests=[AWL=0.052, + SPF_NEUTRAL=0.652] 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 l0tSiscu6P4Z for ; + Fri, 11 Dec 2015 13:53:33 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by arlo.cworth.org (Postfix) with ESMTP id CB3C76DE005F + for ; Fri, 11 Dec 2015 13:53:32 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id AF42310004A; + Fri, 11 Dec 2015 23:53:39 +0200 (EET) +From: Tomi Ollila +To: Daniel Kahn Gillmor , + Notmuch Mail +Subject: Re: [PATCH 1/9] reorganize indexing of multipart/signed and + multipart/encrypted +In-Reply-To: <1449718786-28000-2-git-send-email-dkg@fifthhorseman.net> +References: <1449718786-28000-1-git-send-email-dkg@fifthhorseman.net> + <1449718786-28000-2-git-send-email-dkg@fifthhorseman.net> +User-Agent: Notmuch/0.21+32~g73439f8 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +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: Fri, 11 Dec 2015 21:53:35 -0000 + +On Thu, Dec 10 2015, Daniel Kahn Gillmor wrote: + +> This prepares the codebase for a cleaner changeset for dealing with +> indexing some encrypted messages in the clear. +> --- +> lib/index.cc | 38 ++++++++++++++++++-------------------- +> 1 file changed, 18 insertions(+), 20 deletions(-) +> +> diff --git a/lib/index.cc b/lib/index.cc +> index f166aef..2fa6616 100644 +> --- a/lib/index.cc +> +++ b/lib/index.cc +> @@ -333,27 +333,25 @@ _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)); +> + +> + if (g_mime_multipart_get_count (multipart) > 2) +> + _notmuch_database_log (_notmuch_message_database (message), +> + "Warning: Unexpected extra parts of multipart/signed. Indexing anyway.\n"); +> + } else if (GMIME_IS_MULTIPART_ENCRYPTED (multipart)) { +> + /* Don't index encrypted parts */ + +This could have the _notmuch_message_add_term (message, "tag", "encrypted"); +that was added in next patch file ? + +(i saw your latest proposal, here i am commenting so that the relevant +changes can be done in nest round...) + + +> + } else { +> + for (i = 0; i < g_mime_multipart_get_count (multipart); i++) { +> + _index_mime_part (message, +> + g_mime_multipart_get_part (multipart, i)); +> + } +> } +> return; +> } +> -- +> 2.6.2