From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +LnMHNZY12C1VgAAgWs5BA (envelope-from ) for ; Sat, 26 Jun 2021 18:41:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id oPCDGNZY12BVKwAAB5/wlQ (envelope-from ) for ; Sat, 26 Jun 2021 16:41:58 +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) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 939871023D for ; Sat, 26 Jun 2021 18:41:57 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id E3DBB2904D; Sat, 26 Jun 2021 12:41:53 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id DF18F27D90 for ; Sat, 26 Jun 2021 12:41:50 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 9886C5FD21; Sat, 26 Jun 2021 12:41:50 -0400 (EDT) Received: (nullmailer pid 227659 invoked by uid 1000); Sat, 26 Jun 2021 16:41:49 -0000 From: David Bremner To: Daniel Kahn Gillmor , Notmuch Mail Subject: [PATCH] emacs: Prefer email address over User ID when showing valid signature Date: Sat, 26 Jun 2021 13:41:44 -0300 Message-Id: <20210626164144.227608-1-david@tethera.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210527014459.3082888-2-dkg@fifthhorseman.net> References: <20210527014459.3082888-2-dkg@fifthhorseman.net> MIME-Version: 1.0 Message-ID-Hash: WSO2P634E6RIESQXNVDOW2ZECP5ZJUSY X-Message-ID-Hash: WSO2P634E6RIESQXNVDOW2ZECP5ZJUSY X-MailFrom: bremner@tethera.net 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 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624725717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/5nWVNfvwJcYjoUxCSayNRHDnmILd/XbJjo+VzTd3lM=; b=Tog7aI1iDbzIbOpfcJ6G6pqSTVcZOKswyu0nzOhZ+jRHQrQqVKzy7PRt9gisMlnVpXHNZV 4QnUTXaH8AonMfTbcgngZyo8fl5+pRG+fdi/WY157vhWwRavRY4CwEK2lwA4y6yQQUthmo S8gnQ9NU+DvY62yzRiB9NnhFpLhwcInDqpJPPJn9NEWQKRuEw4UCXj7Nv6hj2f5lpXskTc eK9p3/AcZvoqepXqmSzXHhxhJWXhB5lSZXVBmGfYSNqXwJouWveZLqY83lkGaKQ4U63KN9 4NvF2nR7qKEFKsaMW7ThVCt5FvEtB3W+MET+rafZy8bNBnaky317QV3J9mG9mw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624725717; a=rsa-sha256; cv=none; b=jojxygNaHfcWX6G5vf5afD8/s9zZG3hMdnzFhOkdhNZtrqZ2noZnyqfoA0M26MZcfXAhRM cgk8w5b4iDSMWC/R4HapffP14HljQKcieXbNsodMxOK/RhswZgFBnnBOu+bg9HUac0CvR9 Po1pjvmcnrRYbWLgwf4R/GuUVbjaAsmsguv2pj2xG/CAIr6sQidCYGy5NY16pd042mGDeS l1lbjnXpOER79rhrp2sug9jv7hZ/Dr1kyLv2KoUCVtqtS+ZvrbBfj9Fx+D5lsn9Wm5s5O5 0xcaCx63GZ5KgvKMgRFQ4G1pU45cPhQZl9nw7vuagaqyik3pV9MWByhMo4XFWQ== ARC-Authentication-Results: i=1; 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-Spam-Score: -1.01 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: 939871023D X-Spam-Score: -1.01 X-Migadu-Scanner: scn1.migadu.com X-TUID: 53lKoIRHZtEz From: Daniel Kahn Gillmor Most concrete verification steps are likely only taken on the e-mail address in the first place, and e-mail addresses render more intelligibly than arbitrary User IDs in the first place. Signed-off-by: Daniel Kahn Gillmor Amended-by: db, apply dme restructuring suggestions. --- emacs/notmuch-crypto.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el index db7cb75d..5edfe94c 100644 --- a/emacs/notmuch-crypto.el +++ b/emacs/notmuch-crypto.el @@ -119,14 +119,14 @@ mode." (cond ((string= status "good") (let ((fingerprint (concat "0x" (plist-get sigstatus :fingerprint))) - (userid (plist-get sigstatus :userid))) - ;; If userid is present it has full or greater validity. - (if userid - (progn - (setq label (concat "Good signature by: " userid)) - (setq face 'notmuch-crypto-signature-good)) - (setq label (concat "Good signature by key: " fingerprint)) - (setq face 'notmuch-crypto-signature-good-key)) + (email-or-userid (or (plist-get sigstatus :email) + (plist-get sigstatus :userid)))) + ;; If email or userid are present, they have full or greater validity. + (setq label (concat "Good signature by key: " fingerprint)) + (setq face 'notmuch-crypto-signature-good-key) + (when email-or-userid + (setq label (concat "Good signature by: " email-or-user-id)) + (setq face 'notmuch-crypto-signature-good)) (setq button-action 'notmuch-crypto-sigstatus-good-callback) (setq help-msg (concat "Click to list key ID 0x" fingerprint ".")))) ((string= status "error") -- 2.30.2