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 644996DE12EB for ; Sun, 26 May 2019 15:17:32 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.232 X-Spam-Level: X-Spam-Status: No, score=-0.232 tagged_above=-999 required=5 tests=[AWL=-0.031, 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 qUOMNpFWcPy3 for ; Sun, 26 May 2019 15:17:31 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id 8C8BB6DE1492 for ; Sun, 26 May 2019 15:16:34 -0700 (PDT) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1558908993; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=BXdIa2iqeVnyjfUxEFqSXuwBVNaqn/ffKpNnyppV5FQ=; b=zRGHH234wESIKqi2SeFdRqb8slr2G3fkmhBQJTqBXhHLuh5dJsFuj6E8 cZNIvFIhPhjgLTy4VmczcaTJkdE7Bw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1558908993; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=BXdIa2iqeVnyjfUxEFqSXuwBVNaqn/ffKpNnyppV5FQ=; b=Vw6nPoOTccldJXr8eekiI2Xf3G75i/KZn0ZsmciIh9qp8PNhvRk0MQAu NJmt35Ijpml8txsKLnjY8tULKWl8c1ENWvITG/a4j+M5XI0jIMGZtBJY4j AaFGwx3TPoZMW8DW9n0EfOzI/yKzI6HZjYoUcWS4N/CqfJVO+IqiFG8php oqfC450ml1ofpl1u0nkmarMXw6IMwSlrCAjTyMDAiCujKsVdWCalBFbIV9 TOtWYeDjENMZF4stCNpeoQkxpvy3Hvfem9WspltxO1/BZvdXnzclJTlVRq EKHcasli0RPlK6KeU/+vKBt/aAjU5zONgXtzdZl+7dlyVm/Z9f5B5Q== 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 AA20DF99D for ; Sun, 26 May 2019 18:16:33 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 9BC95214D1; Sun, 26 May 2019 18:16:14 -0400 (EDT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH v2 17/17] cli/reply: pull proposed subject line from the message, not the index Date: Sun, 26 May 2019 18:16:10 -0400 Message-Id: <20190526221610.2833-18-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:17:32 -0000 Protected subject lines were being emitted in reply when the cleartext of documents was indexed. create_reply_message() was pulling the subject line from the index, rather than pulling it from the GMimeMessage object that it already has on hand. This one-line fix to notmuch-reply.c solves that problem, and doesn't cause any additional tests to fail. Signed-off-by: Daniel Kahn Gillmor --- notmuch-reply.c | 2 +- test/T356-protected-headers.sh | 1 - test/T358-emacs-protected-headers.sh | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c index 2689b247..46bab434 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -591,7 +591,7 @@ create_reply_message(void *ctx, from_addr); g_mime_object_set_header (GMIME_OBJECT (reply), "From", from_addr, NULL); - subject = notmuch_message_get_header (message, "subject"); + subject = g_mime_message_get_subject (mime_message); if (subject) { if (strncasecmp (subject, "Re:", 3)) subject = talloc_asprintf (ctx, "Re: %s", subject); diff --git a/test/T356-protected-headers.sh b/test/T356-protected-headers.sh index 746c4760..4af018f3 100755 --- a/test/T356-protected-headers.sh +++ b/test/T356-protected-headers.sh @@ -100,7 +100,6 @@ test_json_nodes <<<"$output" \ 'subject:[0]["subject"]="This is a protected header"' test_begin_subtest "indexed protected subject is not visible in reply header" -test_subtest_known_broken output=$(notmuch reply --format=json 'id:protected-header@crypto.notmuchmail.org') test_json_nodes <<<"$output" \ 'subject:["original"]["headers"]["Subject"]="This is a protected header"' \ diff --git a/test/T358-emacs-protected-headers.sh b/test/T358-emacs-protected-headers.sh index 765511d4..c195d5c2 100755 --- a/test/T358-emacs-protected-headers.sh +++ b/test/T358-emacs-protected-headers.sh @@ -92,7 +92,6 @@ test_expect_equal_file EXPECTED OUTPUT # notmuch-emacs still leaks the subject line: test_begin_subtest "don't leak protected subject during reply, even if indexed" -test_subtest_known_broken test_emacs "(let ((message-hidden-headers '())) (notmuch-show \"id:protected-header@crypto.notmuchmail.org\") (notmuch-show-reply) -- 2.20.1