3 test_description="emacs interface"
4 . $(dirname "$0")/test-lib.sh || exit 1
6 # testing protected headers with emacs
8 add_email_corpus protected-headers
10 test_begin_subtest "notmuch-search should show not unindexed protected subject header in emacs"
11 test_emacs '(notmuch-search "id:protected-header@crypto.notmuchmail.org")
15 2000-01-01 [1/1] test_suite@notmuchmail.org Subject Unavailable (encrypted inbox unread)
16 End of search results.
18 test_expect_equal_file EXPECTED OUTPUT
20 test_begin_subtest "notmuch-show should not show unindexed protected subject header in emacs when nm-c-process-mime is nil"
21 test_emacs '(let ((notmuch-crypto-process-mime nil))
22 (notmuch-show "id:protected-header@crypto.notmuchmail.org")
25 test_suite@notmuchmail.org (2000-01-01) (encrypted inbox)
26 Subject: Subject Unavailable
27 To: test_suite@notmuchmail.org
28 Date: Sat, 01 Jan 2000 12:00:00 +0000
30 [ multipart/encrypted ]
31 [ Unknown encryption status ]
32 [ application/pgp-encrypted ]
33 [ application/octet-stream ]
35 test_expect_equal_file EXPECTED OUTPUT
37 test_begin_subtest "notmuch-show should show protected subject header in emacs"
38 test_emacs '(notmuch-show "id:protected-header@crypto.notmuchmail.org")
41 test_suite@notmuchmail.org (2000-01-01) (encrypted inbox)
42 Subject: This is a protected header
43 To: test_suite@notmuchmail.org
44 Date: Sat, 01 Jan 2000 12:00:00 +0000
46 [ multipart/encrypted ]
47 [ Decryption successful ]
48 [ application/pgp-encrypted ]
50 This is the sekrit message
52 test_expect_equal_file EXPECTED OUTPUT
54 # protected headers should behave differently after re-indexing
55 test_begin_subtest 'defaulting to indexing cleartext'
56 test_expect_success 'notmuch config set index.decrypt true'
57 test_begin_subtest 'try reindexing protected header message'
58 test_expect_success 'notmuch reindex id:protected-header@crypto.notmuchmail.org'
60 test_begin_subtest "notmuch-search should show indexed protected subject header in emacs"
61 test_emacs '(notmuch-search "id:protected-header@crypto.notmuchmail.org")
65 2000-01-01 [1/1] test_suite@notmuchmail.org This is a protected header (encrypted inbox)
66 End of search results.
68 test_expect_equal_file EXPECTED OUTPUT