[PATCH 4/4] lib: index the content-type of the parts of encrypted messages
Jani Nikula
jani at nikula.org
Sat Sep 16 07:59:05 PDT 2017
From: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
This is a logical followup to "lib: index the content type of
signature parts", which will make it easier to record the message
structure of all messages.
---
lib/index.cc | 9 ++++++++-
test/T350-crypto.sh | 1 -
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/index.cc b/lib/index.cc
index 0beaae62f048..ceb444df60bf 100644
--- a/lib/index.cc
+++ b/lib/index.cc
@@ -409,7 +409,14 @@ _index_mime_part (notmuch_message_t *message,
}
}
if (GMIME_IS_MULTIPART_ENCRYPTED (multipart)) {
- /* Don't index encrypted parts. */
+ /* Don't index encrypted parts, but index their content type. */
+ _index_content_type (message,
+ g_mime_multipart_get_part (multipart, i));
+ if ((i != GMIME_MULTIPART_ENCRYPTED_VERSION) &&
+ (i != GMIME_MULTIPART_ENCRYPTED_CONTENT)) {
+ _notmuch_database_log (_notmuch_message_database (message),
+ "Warning: Unexpected extra parts of multipart/encrypted.\n");
+ }
continue;
}
_index_mime_part (message,
diff --git a/test/T350-crypto.sh b/test/T350-crypto.sh
index b8f862560006..53bf4113d622 100755
--- a/test/T350-crypto.sh
+++ b/test/T350-crypto.sh
@@ -236,7 +236,6 @@ test_expect_success \
"(mml-attach-file \"TESTATTACHMENT\") (mml-secure-message-encrypt)"'
test_begin_subtest "encrypted part content-type indexing"
-test_subtest_known_broken
output=$(notmuch search mimetype:multipart/encrypted and mimetype:application/pgp-encrypted and mimetype:application/octet-stream | notmuch_search_sanitize)
test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message 001 (encrypted inbox)"
--
2.11.0
More information about the notmuch
mailing list