unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob f65b8a24137a8eac9f00b76252c3ffca668c0966 1455 bytes (raw)
name: test/T351-pgpmime-mangling.sh 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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

debug log:

solving f65b8a24 ...
found f65b8a24 in https://yhetil.org/notmuch.git/

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).