summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mime-node.c11
-rwxr-xr-xtest/T356-protected-headers.sh2
2 files changed, 10 insertions, 3 deletions
diff --git a/mime-node.c b/mime-node.c
index abb6dd84..599d3b65 100644
--- a/mime-node.c
+++ b/mime-node.c
@@ -333,7 +333,16 @@ _mime_node_set_up_part (mime_node_t *node, GMimeObject *part, int numchild)
node_verify (node, part);
}
} else {
- (void) _notmuch_message_crypto_potential_payload (node->ctx->msg_crypto, part, node->parent ? node->parent->part : NULL, numchild);
+ if (_notmuch_message_crypto_potential_payload (node->ctx->msg_crypto, part, node->parent ? node->parent->part : NULL, numchild) &&
+ node->ctx->msg_crypto->decryption_status == NOTMUCH_MESSAGE_DECRYPTED_FULL) {
+ GMimeObject *clean_payload = _notmuch_repair_crypto_payload_skip_legacy_display (part);
+ if (clean_payload != part) {
+ /* only one layer of recursion is possible here
+ * because there can be only a single cryptographic
+ * payload: */
+ return _mime_node_set_up_part (node, clean_payload, numchild);
+ }
+ }
}
return true;
diff --git a/test/T356-protected-headers.sh b/test/T356-protected-headers.sh
index 43dfffe6..867b8722 100755
--- a/test/T356-protected-headers.sh
+++ b/test/T356-protected-headers.sh
@@ -137,14 +137,12 @@ id:protected-header@crypto.notmuchmail.org
id:subjectless-protected-header@crypto.notmuchmail.org'
test_begin_subtest "when rendering protected headers, avoid rendering legacy-display part"
-test_subtest_known_broken
output=$(notmuch show --format=json id:protected-with-legacy-display@crypto.notmuchmail.org)
test_json_nodes <<<"$output" \
'subject:[0][0][0]["headers"]["Subject"]="Interrupting Cow"' \
'no_legacy_display:[0][0][0]["body"][0]["content"][1]["content-type"]="text/plain"'
test_begin_subtest "when replying, avoid rendering legacy-display part"
-test_subtest_known_broken
output=$(notmuch reply --format=json id:protected-with-legacy-display@crypto.notmuchmail.org)
test_json_nodes <<<"$output" \
'no_legacy_display:["original"]["body"][0]["content"][1]["content-type"]="text/plain"'