[PATCH 18/20] indexing: record protected subject when indexing cleartext

Jameson Graef Rollins jrollins at finestructure.net
Sat Jun 2 10:59:11 PDT 2018


On Fri, May 11 2018, Daniel Kahn Gillmor <dkg at fifthhorseman.net> wrote:
> When indexing the cleartext of an encrypted message, record any
> protected subject in the database, which should make it findable and
> visible in search.
> ---
>  lib/index.cc                   | 42 ++++++++++++++++++++++++++--------
...
> diff --git a/lib/index.cc b/lib/index.cc
> index 0ad683fa..db16b6f8 100644
> --- a/lib/index.cc
> +++ b/lib/index.cc
...
> @@ -430,8 +435,13 @@ _index_mime_part (notmuch_message_t *message,
>  		}
>  		continue;
>  	    }
> -	    _index_mime_part (message, indexopts,
> -			      g_mime_multipart_get_part (multipart, i));
> +	    child = g_mime_multipart_get_part (multipart, i);
> +	    status = _notmuch_message_crypto_potential_payload (msg_crypto, child, part, i);
> +	    if (status)
> +		_notmuch_database_log (_notmuch_message_database (message),
> +				       "Warning: failed to mark the potential cryptographic payload (%s).\n",
> +				       notmuch_status_to_string (status));
> +	    _index_mime_part (message, indexopts, child, msg_crypto);
>  	}
>  	return;
>      }

In 9088db76d89264b733f6b45e776d8952da237921 _notmuch_message_database
was exposed as notmuch_message_get_database, so this patch needs to be
updated:

diff --git a/lib/index.cc b/lib/index.cc
index 74e1ba43..18e712b1 100644
--- a/lib/index.cc
+++ b/lib/index.cc
@@ -438,7 +438,7 @@ _index_mime_part (notmuch_message_t *message,
            child = g_mime_multipart_get_part (multipart, i);
            status = _notmuch_message_crypto_potential_payload (msg_crypto, child, part, i);
            if (status)
-               _notmuch_database_log (_notmuch_message_database (message),
+               _notmuch_database_log (notmuch_message_get_database (message),
                                       "Warning: failed to mark the potential cryptographic payload (%s).\n",
                                       notmuch_status_to_string (status));
            _index_mime_part (message, indexopts, child, msg_crypto);

This fix doesn't affect any of the subsequent patches in this series.

jamie.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20180602/28957387/attachment.sig>


More information about the notmuch mailing list