Re: [PATCH v4 08/16] reorganize indexing of multipart/signed and multipart/encrypted

Subject: Re: [PATCH v4 08/16] reorganize indexing of multipart/signed and multipart/encrypted

Date: Sat, 13 Aug 2016 13:30:30 +0900

To: Daniel Kahn Gillmor, Notmuch Mail

Cc:

From: David Bremner


Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:

> +	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)) {

I'm confused about this warning, or more importantly about whether there
is an indexing behaviour change here. In particular the extra parts are
indexed in a for loop which is now in the else branch of this if, so as
far as I can tell, it won't be run for multipart/signed

Thread: