From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id OAWXCKJW4l/7cQAA0tVLHw (envelope-from ) for ; Tue, 22 Dec 2020 20:27:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id dHJ0BKJW4l+tRwAA1q6Kng (envelope-from ) for ; Tue, 22 Dec 2020 20:27:14 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 77C87940149 for ; Tue, 22 Dec 2020 20:27:12 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 3954929CAB; Tue, 22 Dec 2020 15:27:03 -0500 (EST) X-Greylist: delayed 453 seconds by postgrey-1.36 at nmbug; Tue, 22 Dec 2020 15:27:00 EST Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.31.41]) by mail.notmuchmail.org (Postfix) with ESMTPS id C08CB2853C for ; Tue, 22 Dec 2020 15:27:00 -0500 (EST) Received: from [46.244.197.197] (helo=condition-alpha.com) by smtprelay03.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1kro7t-00029r-U9; Tue, 22 Dec 2020 21:19:22 +0100 Message-Id: <317b3e3799837416740c1b736e02ceea@condition-alpha.com> From: Alexander Adolf To: David Bremner , notmuch@notmuchmail.org Subject: Re: emacs: error decrypting s/mime In-Reply-To: <878sb55vcp.fsf@tethera.net> Date: Tue, 22 Dec 2020 21:19:21 +0100 MIME-Version: 1.0 X-Df-Sender: YWxleGFuZGVyLmFkb2xmQGNvbmRpdGlvbi1hbHBoYS5jb20= Message-ID-Hash: QDSU3XAJSNQO644WBGQ3BEPZ5X6BEW2G X-Message-ID-Hash: QDSU3XAJSNQO644WBGQ3BEPZ5X6BEW2G X-MailFrom: alexander.adolf@condition-alpha.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Daniel Kahn Gillmor X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -0.38 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 77C87940149 X-Spam-Score: -0.38 X-Migadu-Scanner: scn0.migadu.com X-TUID: hQdichm/ZpHp Hello David, David Bremner writes: > David Bremner writes: > >> It's not perfect (the encryption status for S/MIME needs some new UI >> code on the emacs end), but it's better than the status quo, as far as I >> can tell. > > I think this might be a deeper issue. Looking at the structure of > > test/corpora/protected-headers/smime-sign+enc.eml > > it looks like there is an application/pkcs-7 part for the outer > container with an encstatus, and one inside that (with the same mime > type) with a sigstatus. So maybe the right thing is to just ignore > missing encstatus? > [...] After decrypting (i.e. when you see the encstatus), and the decryption was successful (encstatus is not "bad"), the application/pkcs7-mime part has been expanded into a multipart/signed part. This, in turn, then needs to be rendered. In short, the below snippet fixes the issue for me. It could for example be added to notmuch-show.el. ---------------------------- Begin Quote ----------------------------- (defun notmuch-show-insert-part-application/pkcs7-mime (msg part content-type nth depth button) (let* ((encstatus-plist (car (plist-get part :encstatus))) (encstatus (plist-get encstatus-plist :status))) (notmuch-crypto-insert-encstatus-button encstatus-plist) (if (not (string= encstatus "bad")) (notmuch-show-insert-part-multipart/signed msg (car (plist-get part :content)) content-type nth depth button)))) (fset 'notmuch-show-insert-part-application/x-pkcs7-mime 'notmuch-show-insert-part-application/pkcs7-mime) ----------------------------- End Quote ------------------------------ Hoping to have helped, --alexander