From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tomas Volf <~@wolfsden.cz> Newsgroups: gmane.emacs.bugs Subject: bug#74658: Remove the Mail-Followup-To header when empty Date: Tue, 03 Dec 2024 00:17:10 +0100 Message-ID: <87iks14qvd.fsf@wolfsden.cz> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26395"; mail-complaints-to="usenet@ciao.gmane.io" To: 74658@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 03 00:18:14 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tIFgC-0006gn-Hc for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Dec 2024 00:18:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIFg4-0003om-IT; Mon, 02 Dec 2024 18:18:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIFg2-0003oF-RD for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 18:18:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIFg2-0001DS-HF for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 18:18:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=KpkZUDL2PHfxcCK941uZ3I1hgeaohC37N74fAdHAP+8=; b=kMsxgf996ikxgfobTucR341IxyBqIPgfZyJ+l3M3Rgnsj5TO5eybJHOJBpiklMBC7Ks7/uvv9zYWK7IoMfUjS+8+j8JMEpvxd9Rw5FIne2Ai7ZuH9AhNqdwEPvz7eIq3mBASg09tRDBUKdITROXckIOovI2/kTuwIlohFsIyk7JCR6WDBWislDxhW7lm0p/lAHMIDDOM7ri4PKvd/LG7+hNUc5vCBwiNI3md5Oci5CDefSmgEj5RqPep+Kj5qhrbYX9WF1wWqug7sNV220ARlMcYpMDiCX2ZjvEYGOWxGNSo8xlsgwNXYy/cPyICfv8ZsirkgC4KOvbO2T5lNQyaSA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tIFg2-00064m-Ab for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 18:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Dec 2024 23:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74658 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.173318144823287 (code B ref -1); Mon, 02 Dec 2024 23:18:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Dec 2024 23:17:28 +0000 Original-Received: from localhost ([127.0.0.1]:56949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIFfU-00063X-BF for submit@debbugs.gnu.org; Mon, 02 Dec 2024 18:17:28 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:54934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tIFfS-00063P-EL for submit@debbugs.gnu.org; Mon, 02 Dec 2024 18:17:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1tIFfR-0003fn-Ck for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 18:17:25 -0500 Original-Received: from wolfsden.cz ([37.205.8.62]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1tIFfO-00016s-9K for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 18:17:24 -0500 Original-Received: by wolfsden.cz (Postfix, from userid 104) id AB241326F9D; Mon, 2 Dec 2024 23:17:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1733181431; bh=hloGDdkEYCLAPX9nshA6Xj0aG8jpenJ1HlH+wgTR+VE=; h=From:To:Subject:Date; b=ecbUWIlx7lGAMC0K2N/rJ4v9tst2G55XpprB2sgBWbWxH7eCa00q4hPbVGh/0KHfb mIv8Mxic8sI0MlT/VNM0p1AfWtcDLSxAOQm8jLAybjXlMBqLoEPTMVO8++wWtdktyw NHEV6MkYVc/vprfVQdIbhDIxTjxZxZDiJt8m/qSlXKr4PdijkIhYc/YL0ZmMYnNetz D5iZJJgpSYQvvXMzoOLBrUXCpPNLB3AMnGlOX4DeR9TsWjhwc10OvbPruiL7rvW+oS 2lbBoo+HbLVQUlSBbeGoXJ42TqmSQLfvfnufHs/HyGetCXFn/6EW2kUBVDgbvq1wGt x/PYp9+kgl0kEnWJt8dO43KV9QxSS9dv0QpfglB/WGcdn26VyTA6OVx4kGIjLNbp9a M2RaRX3HYp3TqApX0AWLEM0bK3pFZLrDAS3nxkMyyahrEb687Lrh2oC7cKwr80frDL QI92oqxfFxxRrw7Kr9bQ8bIFv3avXX1QyUREtzdH8Um6c/WjrdV24aiAJDorfMJPje mQ1IX5PA0gllEmBlSvmaBl1JNM/zMn9qF/l6Qr/VwNBN5qxmN19DqEspEpcpevnGkp VIavpmCJMFEHFpRq9UQ7i54HIcNmstsXA32/7ulQpCsYNA/psn6pxiajzYuUaZkSEO JgakupL6xnNRJ4yjUVl2vicg= Original-Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id CFFA83266C7 for ; Mon, 2 Dec 2024 23:17:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1733181430; bh=hloGDdkEYCLAPX9nshA6Xj0aG8jpenJ1HlH+wgTR+VE=; h=From:To:Subject:Date; b=YQ9DgMiO8ImgyV1oVrrxFK26jQwMD8VcMJlm/64vrAPGnAeE3lwgOQE7Ej8RFmRlR 4pmIAv1qKaMn9YYoDHWWwFIYVy3GMTt5UlRZPaHiVoW5RmHYgYf7Evoq77qOBqiqU8 Z3Jwl9QtQRC+pQpb6wj3mFRIrcsx2EgKQ2bzKNnkiuFarLaQJZIZEIbJuTBS/xSWz9 beDiDPkNA4sI87OAaxtRqnZhaA/oOfaW1yKCD3S6gF7qxGcTXiZyU00pOvhXXbIiwk S4MM3Xxm6VGBt+5ovnOFAgqTLnp2zZ2ECs2PNt4lktiSIOZMt8iZwcaYD2SNrU/m1t bdkOAJUTCaxIt0frGC4gBHx0muGQhgrh3Ds4fHDfE6N0n7G8U70ibAMoGuUtSKTDW1 LXUV7VFEGTawMpmLzqX/zALM5lwlNAdh/m8dNMPF7TKP2e5hDZ7IW9cSlYQNQqeklV EQsfFMh0STfZYQHMtpEkE1iZqAUdUFF4oV8Sc0Phc53Qy0mCPTadqZc5WmqbNd5He9 H1ZKsnutVldasNtyJ0q9Pw3pWmKv8lRVDVpSE81ZxNDSnfZjwLRGJJuVkKBsCeK1OQ BFTurpGWCA4LA6NaAw7BW5M3Rpg/r4Y5Jzo7f52nv8BeS/wZDaHiqrZv6qmbQK92Vf 4U9eIgYKnVyywsIe1GAOoMtA= Received-SPF: pass client-ip=37.205.8.62; envelope-from=~@wolfsden.cz; helo=wolfsden.cz X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296345 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Tags: patch According to the info manual (message)Mailing Lists, the Mail-Followup-To header should be removed when it is empty: > If there is one, it is left alone. (Except if it=E2=80=99s empty; in that > case, the field is removed and is not replaced with an automatically > generated one. This lets you disable MFT generation on a per-message > basis.) While the code attempted to do that, the call to `message-remove-header' passed wrong arguments. Since the IS-REGEXP argument was not passed, the HEADER was considered a full header name (if I read the code right) and therefore failed to match (since the code passed in a regexp instead of a fixed string). The fix is simple, remove the leading ^ and trailing :. Change log entry as requested: Actually remove the Mail-Followup-To header iff empty in message-send-mail. * lisp/gnus/message.el (message-send-mail) [(equal "" (mail-fetch-field "mail-followup-to")]: Pass a fixed string instead of regexp to `message-remove-header'. In GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0) Windowing system distributor 'The X.Org Foundation', version 11.0.12101012 System Description: Guix System Configured using: 'configure CONFIG_SHELL=3D/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.= 1.16/bin/bash SHELL=3D/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.1.16/bi= n/bash --prefix=3D/gnu/store/s8757iarmns4dpklil8pgdikmb68v7bf-emacs-29.4 --enable-fast-install --with-cairo --with-modules --with-native-compilation=3Daot --disable-build-details' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=mail-followup-to.patch diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index b49e3f9d9ca..b4c5a1e2436 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4900,7 +4900,7 @@ If you always want Gnus to send messages in one piece, set message-required-mail-headers)) ;; otherwise, delete the MFT header if the field is empty (when (equal "" (mail-fetch-field "mail-followup-to")) - (message-remove-header "^Mail-Followup-To:"))) + (message-remove-header "Mail-Followup-To"))) ;; Insert some headers. (let ((message-deletable-headers (if news nil message-deletable-headers))) --=-=-=--