X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT351-pgpmime-mangling.sh;fp=test%2FT351-pgpmime-mangling.sh;h=f65b8a24137a8eac9f00b76252c3ffca668c0966;hp=0000000000000000000000000000000000000000;hb=cb522fb06ef534a485408de608984d1be6dbadfa;hpb=e0e55c5b6fd27a96601de95cfcec2b67d8a20c76 diff --git a/test/T351-pgpmime-mangling.sh b/test/T351-pgpmime-mangling.sh new file mode 100755 index 00000000..f65b8a24 --- /dev/null +++ b/test/T351-pgpmime-mangling.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +test_description='PGP/MIME message mangling' +. $(dirname "$0")/test-lib.sh || exit 1 + +add_gnupg_home +add_email_corpus mangling + +bodytext='["body"][0]["content"][1]["content"]="The password is \"abcd1234!\", please do not tell anyone.\n"' + +test_begin_subtest "show 'Mixed-Up' mangled PGP/MIME message correctly" +test_subtest_known_broken +output=$(notmuch show --format=json --decrypt=true id:mixed-up@mangling.notmuchmail.org) +test_json_nodes <<<"$output" \ + 'body:[0][0][0]'"$bodytext" + +test_begin_subtest "reply to 'Mixed-Up' mangled PGP/MIME message correctly" +test_subtest_known_broken +output=$(notmuch reply --format=json --decrypt=true id:mixed-up@mangling.notmuchmail.org) +test_json_nodes <<<"$output" \ + 'body:["original"]'"$bodytext" + +test_begin_subtest "repaired 'Mixed-up' messages can be found with index.repaired=mixedup" +test_subtest_known_broken +output=$(notmuch search --output=messages property:index.repaired=mixedup) +test_expect_equal "$output" id:mixed-up@mangling.notmuchmail.org + +test_begin_subtest "index cleartext of 'Mixed-Up' mangled PGP/MIME message" +test_expect_success 'notmuch reindex --decrypt=true id:mixed-up@mangling.notmuchmail.org' + +test_begin_subtest "search cleartext of 'Mixed-Up' mangled PGP/MIME message" +test_subtest_known_broken +output=$(notmuch search --output=messages body:password) +test_expect_equal "$output" id:mixed-up@mangling.notmuchmail.org + +test_done