diff options
| author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2019-05-27 18:40:28 -0400 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2019-05-29 08:14:44 -0300 |
| commit | 5c3a44681f2fffbd3a7d76e424c134a82470ddd2 (patch) | |
| tree | 1c4fc953220fc819536ac6746cbc96e57e2ba37e /test | |
| parent | b7b553e732baed620f6688570829a4d46dd5f6e5 (diff) | |
indexing: record protected subject when indexing cleartext
When indexing the cleartext of an encrypted message, record any
protected subject in the database, which should make it findable and
visible in search.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Diffstat (limited to 'test')
| -rwxr-xr-x | test/T356-protected-headers.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/T356-protected-headers.sh b/test/T356-protected-headers.sh index ff37f6bd..fee3b043 100755 --- a/test/T356-protected-headers.sh +++ b/test/T356-protected-headers.sh @@ -83,4 +83,20 @@ test_json_nodes <<<"$output" \ 'subject:["original"]["headers"]["Subject"]="This is a protected header"' \ 'reply-subject:["reply-headers"]["Subject"]="Re: Subject Unavailable"' +test_begin_subtest "protected subject is not indexed by default" +output=$(notmuch search --output=messages 'subject:"This is a protected header"') +test_expect_equal "$output" '' + +test_begin_subtest "reindex message with protected header" +test_expect_success 'notmuch reindex --decrypt=true id:protected-header@crypto.notmuchmail.org' + +test_begin_subtest "protected subject is indexed when cleartext is indexed" +output=$(notmuch search --output=messages 'subject:"This is a protected header"') +test_expect_equal "$output" 'id:protected-header@crypto.notmuchmail.org' + +test_begin_subtest "indexed protected subject is visible in search" +output=$(notmuch search --format=json 'id:protected-header@crypto.notmuchmail.org') +test_json_nodes <<<"$output" \ + 'subject:[0]["subject"]="This is a protected header"' + test_done |
