X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT356-protected-headers.sh;h=925805df16e8349df2144db03e53cb9d450e0bf5;hp=4af018f30dc89620801dc88cff28172e7ae69937;hb=74a1b5ac65b31f7ebc1258b259b8c355023e21b4;hpb=1c704dd22d81b2d6307125d47cc895127f8e34c9 diff --git a/test/T356-protected-headers.sh b/test/T356-protected-headers.sh index 4af018f3..925805df 100755 --- a/test/T356-protected-headers.sh +++ b/test/T356-protected-headers.sh @@ -136,4 +136,33 @@ id:nested-rfc822-message@crypto.notmuchmail.org 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" +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" +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"' + +test_begin_subtest "do not treat legacy-display part as body when indexing" +output=$(notmuch search --output=messages body:interrupting) +test_expect_equal "$output" '' + +test_begin_subtest "identify message that had a legacy display part skipped during indexing" +output=$(notmuch search --output=messages property:index.repaired=skip-protected-headers-legacy-display) +test_expect_equal "$output" id:protected-with-legacy-display@crypto.notmuchmail.org + +# TODO: test that a part that looks like a legacy-display in +# multipart/signed, but not encrypted, is indexed and not stripped. + +# TODO: test that a legacy-display in a decrypted subpart (not in the +# cryptographic payload) is indexed and not stripped. + +# TODO: test that a legacy-display inside multiple MIME layers that +# include an encryption layer (e.g. multipart/encrypted around +# multipart/signed) is stripped and not indexed. + test_done