From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id EOfxEXwju16NegAA0tVLHw (envelope-from ) for ; Tue, 12 May 2020 22:30:20 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id iNLVLooju14MbAAAB5/wlQ (envelope-from ) for ; Tue, 12 May 2020 22:30:34 +0000 Received: from arlo.cworth.org (unknown [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 38835940D36 for ; Tue, 12 May 2020 22:30:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 2DA366DE146A; Tue, 12 May 2020 15:30:12 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 AZvJOID4zX0T; Tue, 12 May 2020 15:30:11 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 04EBE6DE13E3; Tue, 12 May 2020 15:30:03 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id D00346DE13D6 for ; Tue, 12 May 2020 15:29:59 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 yQncVB2fnKno for ; Tue, 12 May 2020 15:29:57 -0700 (PDT) Received: from che.mayfirst.org (unknown [162.247.75.117]) by arlo.cworth.org (Postfix) with ESMTPS id 4DCCF6DE13DE for ; Tue, 12 May 2020 15:29:56 -0700 (PDT) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1589322594; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=oYfq8BeZCW7v6gh4neRNcPAR6kiyQTIMexC72fF/+a8=; b=Zn/OXnfQjlS3oLHxMIJ/uv5B/pvXklq89LaXb8Ql5WbEVpmw5fMyC1BtPZx0WsIIg4Smb pKj80hr2Z/jBvlrAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1589322594; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=oYfq8BeZCW7v6gh4neRNcPAR6kiyQTIMexC72fF/+a8=; b=fC9Ul1GFOLv/pKowcq2Pzu62ohGunc/xPwuNwGNSnndIWRtsUmd4CmIxwdOm7pcoRYMuy 4o8mVWViW2tz84EvfRluF1dFBeC60TytXQcMwURLEmWMYqBaZdPu/nOVRjHfKAWaAx8R099 DcVOPXv0pVEB59TaaGDo1XdI8oPCTHvLA2Qyp7uD6KCSre70gPAZAcC/Z3TN9uZ87p+sc8F R77n/3lb8n20yqbEymjA6AAQv/d93Z862y344AXXimlFCjILdIEnwePbC7HF0zyXjjYna0f UCC2Fe2yHFKnjl/TolDMcgsXY/kWsNN3Tthjc28ehDNhbKeqNhhFUuk/5Exw== Received: from fifthhorseman.net (unknown [IPv6:2001:470:1f07:60d:f2de:f1ff:fec3:d109]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id C5EFBF9A9 for ; Tue, 12 May 2020 18:29:54 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id E733920C3B; Tue, 12 May 2020 18:29:51 -0400 (EDT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH v2 5/9] cli/reply: Ignore PKCS#7 wrapper parts when replying Date: Tue, 12 May 2020 18:29:35 -0400 Message-Id: <20200512222939.372093-6-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512222939.372093-1-dkg@fifthhorseman.net> References: <20200512222939.372093-1-dkg@fifthhorseman.net> MIME-Version: 1.0 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 X-Spam-Score: 4.59 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=fifthhorseman.net header.s=2019 header.b=Zn/OXnfQ; dkim=fail (body hash did not verify) header.d=fifthhorseman.net header.s=2019rsa header.b=fC9Ul1GF; dmarc=fail reason="SPF not aligned (relaxed)" header.from=fifthhorseman.net (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Scan-Result: default: False [4.59 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; RDNS_NONE(1.00)[]; GENERIC_REPUTATION(0.00)[-0.44777360495801]; FORGED_SENDER_MAILLIST(0.00)[]; DWL_DNSWL_BLOCKED(0.00)[50.126.95.6:from]; IP_REPUTATION_HAM(0.00)[asn: 27017(-0.18), country: US(-0.00), ip: 50.126.95.6(-0.45)]; R_SPF_ALLOW(-0.20)[+a]; R_DKIM_REJECT(1.00)[fifthhorseman.net:s=2019,fifthhorseman.net:s=2019rsa]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.50)[cached: notmuchmail.org]; DKIM_TRACE(0.00)[fifthhorseman.net:-]; MAILLIST(-0.20)[mailman]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:27017, ipnet:50.126.64.0/18, country:US]; FROM_NEQ_ENVFROM(0.00)[dkg@fifthhorseman.net,notmuch-bounces@notmuchmail.org]; RDNS_DNSFAIL(0.00)[]; ARC_NA(0.00)[]; URIBL_BLOCKED(0.00)[notmuchmail.org:email,fifthhorseman.net:email]; FROM_HAS_DN(0.00)[]; SPF_REPUTATION_HAM(0.00)[-0.41288670086065]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[notmuch@notmuchmail.org]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; DNSWL_BLOCKED(0.00)[50.126.95.6:from]; MID_CONTAINS_FROM(1.00)[]; HFILTER_HOSTNAME_UNKNOWN(2.50)[]; RCVD_COUNT_SEVEN(0.00)[8]; DMARC_POLICY_SOFTFAIL(0.10)[fifthhorseman.net : SPF not aligned (relaxed),none] X-TUID: lZyAzDmBBkc7 When composing a reply, no one wants to see this line in the proposed message: Non-text part: application/pkcs7-mime So we hide it, the same way we hide PGP/MIME cruft. Signed-off-by: Daniel Kahn Gillmor --- notmuch-reply.c | 5 +++-- test/T355-smime.sh | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c index 2c30f6f9..ceb4f39b 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -65,8 +65,9 @@ format_part_reply (GMimeStream *stream, mime_node_t *node) GMimeContentDisposition *disposition = g_mime_object_get_content_disposition (node->part); if (g_mime_content_type_is_type (content_type, "application", "pgp-encrypted") || - g_mime_content_type_is_type (content_type, "application", "pgp-signature")) { - /* Ignore PGP/MIME cruft parts */ + g_mime_content_type_is_type (content_type, "application", "pgp-signature") || + g_mime_content_type_is_type (content_type, "application", "pkcs7-mime")) { + /* Ignore PGP/MIME and S/MIME cruft parts */ } else if (g_mime_content_type_is_type (content_type, "text", "*") && ! g_mime_content_type_is_type (content_type, "text", "html")) { show_text_part_content (node->part, stream, NOTMUCH_SHOW_TEXT_PART_REPLY); diff --git a/test/T355-smime.sh b/test/T355-smime.sh index 03aada20..8d225bc1 100755 --- a/test/T355-smime.sh +++ b/test/T355-smime.sh @@ -156,7 +156,6 @@ OpenPGP Example Corp" test_expect_equal "$expected" "$output" test_begin_subtest "reply to PKCS#7 SignedData message with proper quoting and attribution" -test_subtest_known_broken output=$(notmuch reply id:smime-onepart-signed@protected-headers.example) expected="From: Notmuch Test Suite Subject: Re: The FooCorp contract -- 2.26.2