From unknown Thu Jun 19 14:02:56 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#42913 <42913@debbugs.gnu.org> To: bug#42913 <42913@debbugs.gnu.org> Subject: Status: [PATCH] Fix issues with OpenPGP header Reply-To: bug#42913 <42913@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:02:56 +0000 retitle 42913 [PATCH] Fix issues with OpenPGP header reassign 42913 emacs submitter 42913 "Philip K." severity 42913 normal tag 42913 patch fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 18 09:22:07 2020 Received: (at submit) by debbugs.gnu.org; 18 Aug 2020 13:22:07 +0000 Received: from localhost ([127.0.0.1]:34496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k81Z1-00021d-El for submit@debbugs.gnu.org; Tue, 18 Aug 2020 09:22:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:60762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k81Yw-00021F-5x for submit@debbugs.gnu.org; Tue, 18 Aug 2020 09:22:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k81Yv-0007HC-N1 for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2020 09:22:01 -0400 Received: from mout02.posteo.de ([185.67.36.66]:35127) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k81Ys-00012r-Q4 for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2020 09:22:01 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 8A5832400FD for ; Tue, 18 Aug 2020 15:21:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1597756914; bh=7cqrZZtvmMy2dozfnP5//E6SfhKnGv3zH6aIfr0t43g=; h=From:To:Subject:Date:OpenPGP:From; b=AzejrEh12lh/WjKCjQlwZqZf68gz6e+ojRZpCqpNbexCqXSKUqIIXaW3z8S0qkrff swvtnRufaGZwOF6bGSCHum0G2RxAYJNZuqf88mbbhh5f8uwt+znehxG+yVh7eh0YVt jzceCBAicfQYmuCxamhe3wLFjmjHx0VWp84WtstIV+q1aSlu7u4G1r/MVYqr1O5hex Ef8G8+UToKzOxnFMGhD/MRxgy1cuEVuOGilaqHvjbSdpGzNEjVXv7oDzMpvxjE/lUW PkmOa+3EgdNH2czPGEKIxMYr4ZY0iDQ8CN3SvtCv+MF4q8J92VO6LiZwkqFD40ec5r Y0RKdm6zNMKfg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4BWBQT73dzz9rxm for ; Tue, 18 Aug 2020 15:21:53 +0200 (CEST) From: "Philip K." To: bug-gnu-emacs@gnu.org Subject: [PATCH] Fix issues with OpenPGP header Date: Tue, 18 Aug 2020 15:21:53 +0200 Message-ID: <87tux0qeby.fsf@posteo.net> OpenPGP: id=6D6F982F77B468D9D8A2C8C8181F5B95AE30B336 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/18 09:21:54 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Hi, I submitted a patch a few months ago, to generate OpenPGP headers, that seems like it was a bit faulty. When trying it out today, it didn't seem to work properly, so I debugged it and made a few changes attached below. My appologies for not testing the patch thoroughly enough. I hope everything is fixed now. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Fix-issues-with-OpenPGP-header.patch >From 1053988e26dd614aeb4490ae853d2c1c502cc493 Mon Sep 17 00:00:00 2001 From: Philip K Date: Tue, 18 Aug 2020 15:12:51 +0200 Subject: [PATCH] Fix issues with OpenPGP header * doc/misc/message.texi (OpenPGP Header): Mention correct hook * lisp/gnus/message.el (message-openpgp-header): Improve customize type (message-add-openpgp-header): Insert header into correct buffer --- doc/misc/message.texi | 2 +- lisp/gnus/message.el | 63 ++++++++++++++++++++++--------------------- 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/doc/misc/message.texi b/doc/misc/message.texi index 204a6386e0..55b166eb8b 100644 --- a/doc/misc/message.texi +++ b/doc/misc/message.texi @@ -1265,7 +1265,7 @@ OpenPGP Header To use this in Message, say: @lisp -(add-hook 'message-send-hook 'message-add-openpgp-header) +(add-hook 'message-header-setup-hook 'message-add-openpgp-header) @end lisp @noindent diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index ab625be9e3..07ff489038 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -2751,16 +2751,17 @@ message-openpgp-header or `message-openpgp-header' is itself nil, the OpenPGP header will not be inserted." :type '(choice - (const nil :tag "Don't add OpenPGP header") - (list (choice (string :tag "ID") - (const nil :tag "No ID")) + (const :tag "Don't add OpenPGP header" nil) + (list :tag "Use OpenPGP header" + (choice (string :tag "ID") + (const :tag "No ID" nil)) (choice (string :tag "Key") - (const nil :tag "No Key")) - (choice (other nil :tag "None") - (const "unprotected" :tag "Unprotected") - (const "sign" :tag "Sign") - (const "encrypt" :tag "Encrypt") - (const "signencrypt" :tag "Sign and Encrypt")))) + (const :tag "No Key" nil)) + (choice (other :tag "None" nil) + (const :tag "Unprotected" "unprotected") + (const :tag "Sign" "sign") + (const :tag "Encrypt" "encrypt") + (const :tag "Sign and Encrypt" "signencrypt")))) :version "28.1") (defun message-add-openpgp-header () @@ -2768,32 +2769,34 @@ message-add-openpgp-header Header will be constructed as specified in `message-openpgp-header'. -Consider adding this function to `message-send-hook'." +Consider adding this function to `message-header-setup-hook'" ;; See https://tools.ietf.org/html/draft-josefsson-openpgp-mailnews-header (when (and message-openpgp-header (or (nth 0 message-openpgp-header) (nth 1 message-openpgp-header) (nth 2 message-openpgp-header))) - (with-temp-buffer - (insert "OpenPGP: ") - ;; add ID - (let (need-sep) - (when (nth 0 message-openpgp-header) - (insert "id=" (nth 0 message-openpgp-header)) - (setq need-sep t)) - ;; add URL - (when (nth 1 message-openpgp-header) - (when need-sep (insert "; ")) - (if (string-match-p ";") - (insert "url=\"" (nth 1 message-openpgp-header) "\"") - (insert "url=\"" (nth 1 message-openpgp-header) "\"")) - (setq need-sep t)) - ;; add preference - (when (nth 2 message-openpgp-header) - (when need-sep (insert "; ")) - (insert "preference=" (nth 2 message-openpgp-header)))) - ;; insert header - (message-add-header (buffer-string))))) + (message-add-header + (with-temp-buffer + (insert "OpenPGP: ") + ;; add ID + (let (need-sep) + (when (nth 0 message-openpgp-header) + (insert "id=" (nth 0 message-openpgp-header)) + (setq need-sep t)) + ;; add URL + (when (nth 1 message-openpgp-header) + (when need-sep (insert "; ")) + (if (string-match-p ";") + (insert "url=\"" (nth 1 message-openpgp-header) "\"") + (insert "url=\"" (nth 1 message-openpgp-header) "\"")) + (setq need-sep t)) + ;; add preference + (when (nth 2 message-openpgp-header) + (when need-sep (insert "; ")) + (insert "preference=" (nth 2 message-openpgp-header)))) + ;; insert header + (buffer-string))) + (message-sort-headers))) -- 2.26.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 18 12:06:53 2020 Received: (at 42913) by debbugs.gnu.org; 18 Aug 2020 16:06:53 +0000 Received: from localhost ([127.0.0.1]:36733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k848T-00033L-Ax for submit@debbugs.gnu.org; Tue, 18 Aug 2020 12:06:53 -0400 Received: from quimby.gnus.org ([95.216.78.240]:34132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k848O-000330-7m for 42913@debbugs.gnu.org; Tue, 18 Aug 2020 12:06:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=muWTLFkRrPMmD6kQCewVoUWh621pK+1uvy4qVPBm4ew=; b=ChxbOx8sTC8dBJVNV1snwzn4Px 4s+OHR0UwGRLbL5QFtT4i+YQoeQNGbY0sbjmOuHcDypK01WVyPHfpbLI/JKChF4hqMo0p1odsJYAu AroamtkpR67ESSdh/xJXoUEV1bNaTVYJCw98Vcnrw32AbF5Qp2T9pYxrZupS5NZEIuQs=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k848C-00006s-0Z; Tue, 18 Aug 2020 18:06:41 +0200 From: Lars Ingebrigtsen To: "Philip K." Subject: Re: bug#42913: [PATCH] Fix issues with OpenPGP header References: <87tux0qeby.fsf@posteo.net> X-Now-Playing: Richenel's _L'Esclave Endormi_: "L'Esclave Endormi" Date: Tue, 18 Aug 2020 18:06:34 +0200 In-Reply-To: <87tux0qeby.fsf@posteo.net> (Philip K.'s message of "Tue, 18 Aug 2020 15:21:53 +0200") Message-ID: <87r1s4hrat.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: "Philip K." writes: > I submitted a patch a few months ago, to generate OpenPGP headers, that > seems like it was a bit faulty. When trying it out today, it didn't seem > to work properly, so I debugged it and made a few [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 42913 Cc: 42913@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) "Philip K." writes: > I submitted a patch a few months ago, to generate OpenPGP headers, that > seems like it was a bit faulty. When trying it out today, it didn't seem > to work properly, so I debugged it and made a few changes attached > below. Thanks; applied to Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 18 12:06:56 2020 Received: (at control) by debbugs.gnu.org; 18 Aug 2020 16:06:57 +0000 Received: from localhost ([127.0.0.1]:36736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k848W-00033c-IP for submit@debbugs.gnu.org; Tue, 18 Aug 2020 12:06:56 -0400 Received: from quimby.gnus.org ([95.216.78.240]:34146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k848T-00033A-95 for control@debbugs.gnu.org; Tue, 18 Aug 2020 12:06:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CtOAm9zIiX/2Lyw82VZpNXs2P3FusWe/BxlMC1jV9LE=; b=USwS9SwLL8eT7dhHZGSx1pkZsG zB1tsVMbmaYktTU5aSTS4qB8gHi46DUR978m1heUbRj3bJ8UyRMGezn8fwQsmtRw4N3pNmpf0ZWpc 12d5pSy1m4PKgoTlvkoLrMfW4aowwgVwbnJmpGDM6Aky1Kho+jsulVX/EY3M/axdhiEI=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k848L-00006z-HU for control@debbugs.gnu.org; Tue, 18 Aug 2020 18:06:47 +0200 Date: Tue, 18 Aug 2020 18:06:44 +0200 Message-Id: <87pn7ohraj.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #42913 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 42913 fixed close 42913 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 42913 fixed close 42913 28.1 quit From unknown Thu Jun 19 14:02:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 16 Sep 2020 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator