3 test_description='PGP/MIME message mangling'
4 . $(dirname "$0")/test-lib.sh || exit 1
7 add_email_corpus mangling
9 bodytext='["body"][0]["content"][1]["content"]="The password is \"abcd1234!\", please do not tell anyone.\n"'
11 test_begin_subtest "show 'Mixed-Up' mangled PGP/MIME message correctly"
12 output=$(notmuch show --format=json --decrypt=true id:mixed-up@mangling.notmuchmail.org)
13 test_json_nodes <<<"$output" \
14 'body:[0][0][0]'"$bodytext"
16 test_begin_subtest "reply to 'Mixed-Up' mangled PGP/MIME message correctly"
17 output=$(notmuch reply --format=json --decrypt=true id:mixed-up@mangling.notmuchmail.org)
18 test_json_nodes <<<"$output" \
19 'body:["original"]'"$bodytext"
21 test_begin_subtest "repaired 'Mixed-up' messages can be found with index.repaired=mixedup"
22 output=$(notmuch search --output=messages property:index.repaired=mixedup)
23 test_expect_equal "$output" id:mixed-up@mangling.notmuchmail.org
25 test_begin_subtest "index cleartext of 'Mixed-Up' mangled PGP/MIME message"
26 test_expect_success 'notmuch reindex --decrypt=true id:mixed-up@mangling.notmuchmail.org'
28 test_begin_subtest "search cleartext of 'Mixed-Up' mangled PGP/MIME message"
29 output=$(notmuch search --output=messages body:password)
30 test_expect_equal "$output" id:mixed-up@mangling.notmuchmail.org