From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 80FA96DE140C for ; Sun, 26 May 2019 15:16:22 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.176 X-Spam-Level: X-Spam-Status: No, score=-0.176 tagged_above=-999 required=5 tests=[AWL=0.025, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5u3i6EIjOUMz for ; Sun, 26 May 2019 15:16:21 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id F0E736DE1333 for ; Sun, 26 May 2019 15:16:19 -0700 (PDT) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1558908977; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=IIfhetgKrZWOwrufoH9R4kuQSyTpyoaP8LFKxF8gJOs=; b=Z4IBvATN8ohbAZlr6SMxYdHeUCXVwcVxcCNptIxncfmHhzYilJya0oLm g+vN+pl4UK/vVq8utoV5lFoSX0bmBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1558908977; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=IIfhetgKrZWOwrufoH9R4kuQSyTpyoaP8LFKxF8gJOs=; b=Ht46szoRvwlRNUjbkexR0EFejnBb5S+hipWK7/u6csh55j4KAq/6Kz4I TZkgKNvIYKBHy/pNLz02RSPW/2Fx13qbQqhZv2VWlkIjm9lFHoUoSoEqX5 ZK4FgHMFkp1G5HCVVom+aZ8HVoQ9G9Vp4cISpqWzooCjFW7F/wFa6d0v/r sSVFPHXlG46+HJF+AUO5QIDXI6IpppMSXaaq749YyrRmMi5SZsIY9EqM3p Z3eZxYV58oBHZVsIVYreg2SHpI8vGtdiEKU1QaIde2WBHKq+t2C8En2GW3 t/iLcAXP+nIiH+aIhNUPFUuF8WVS0AsblYxRxmVCgbl2Vh5x1XJQ7A== Received: from fifthhorseman.net (cpe-74-71-53-242.nyc.res.rr.com [74.71.53.242]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id 53F5FF99E for ; Sun, 26 May 2019 18:16:17 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 905EC2141F; Sun, 26 May 2019 18:16:14 -0400 (EDT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH v2 15/17] test: emacs/show: ensure that protected headers appear as expected Date: Sun, 26 May 2019 18:16:08 -0400 Message-Id: <20190526221610.2833-16-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190526221610.2833-1-dkg@fifthhorseman.net> References: <20190526221610.2833-1-dkg@fifthhorseman.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2019 22:16:22 -0000 This tests notmuch-show; headers appear appropriately based on the setting of notmuch-crypto-process-mime. Signed-off-by: Daniel Kahn Gillmor --- test/T358-emacs-protected-headers.sh | 36 +++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/test/T358-emacs-protected-headers.sh b/test/T358-emacs-protected-headers.sh index 56ac06ca..a631223e 100755 --- a/test/T358-emacs-protected-headers.sh +++ b/test/T358-emacs-protected-headers.sh @@ -17,6 +17,40 @@ End of search results. EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "notmuch-show should not show unindexed protected subject header in emacs when nm-c-process-mime is nil" +test_emacs '(let ((notmuch-crypto-process-mime nil)) + (notmuch-show "id:protected-header@crypto.notmuchmail.org") + (test-output))' +cat <EXPECTED +test_suite@notmuchmail.org (2000-01-01) (encrypted inbox) +Subject: Subject Unavailable +To: test_suite@notmuchmail.org +Date: Sat, 01 Jan 2000 12:00:00 +0000 + +[ multipart/encrypted ] +[ Unknown encryption status ] +[ application/pgp-encrypted ] +[ application/octet-stream ] +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "notmuch-show should show protected subject header in emacs" +test_emacs '(notmuch-show "id:protected-header@crypto.notmuchmail.org") + (test-output)' +cat <EXPECTED +test_suite@notmuchmail.org (2000-01-01) (encrypted inbox) +Subject: This is a protected header +To: test_suite@notmuchmail.org +Date: Sat, 01 Jan 2000 12:00:00 +0000 + +[ multipart/encrypted ] +[ Decryption successful ] +[ application/pgp-encrypted ] +[ text/plain ] +This is the sekrit message +EOF +test_expect_equal_file EXPECTED OUTPUT + # protected headers should behave differently after re-indexing test_begin_subtest 'defaulting to indexing cleartext' test_expect_success 'notmuch config set index.decrypt true' @@ -28,7 +62,7 @@ test_emacs '(notmuch-search "id:protected-header@crypto.notmuchmail.org") (notmuch-test-wait) (test-output)' cat <EXPECTED - 2000-01-01 [1/1] test_suite@notmuchmail.org This is a protected header (encrypted inbox unread) + 2000-01-01 [1/1] test_suite@notmuchmail.org This is a protected header (encrypted inbox) End of search results. EOF test_expect_equal_file EXPECTED OUTPUT -- 2.20.1