From unknown Sun Aug 17 00:58:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#59007: rmail-forward generates wrong-type-argument error Resent-From: Nicolas Graner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Nov 2022 21:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59007 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 59007@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16675122001074 (code B ref -1); Thu, 03 Nov 2022 21:50:01 +0000 Received: (at submit) by debbugs.gnu.org; 3 Nov 2022 21:50:00 +0000 Received: from localhost ([127.0.0.1]:50943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqi63-0000HG-Ry for submit@debbugs.gnu.org; Thu, 03 Nov 2022 17:50:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:60828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqi5z-0000H4-Ip for submit@debbugs.gnu.org; Thu, 03 Nov 2022 17:49:58 -0400 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 1oqi5z-00042N-Dw for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 17:49:55 -0400 Received: from ouvsmtp1.octopuce.fr ([194.36.166.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqi5x-0001XY-05 for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 17:49:54 -0400 Received: from panel.vitry.ouvaton.coop (unknown [194.36.166.20]) by ouvsmtp1.octopuce.fr (Postfix) with ESMTPS id 2FD121E8 for ; Thu, 3 Nov 2022 22:49:45 +0100 (CET) Received: from hypra-graner (215.124.67.86.rev.sfr.net [86.67.124.215]) by panel.vitry.ouvaton.coop (Postfix) with ESMTPSA id CAE395E1764 for ; Thu, 3 Nov 2022 22:49:44 +0100 (CET) From: Nicolas Graner Date: Thu, 03 Nov 2022 22:49:43 +0100 Message-ID: <87v8nv4sjs.fsf@universite-paris-saclay.fr> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=194.36.166.50; envelope-from=nicolas@graner.name; helo=ouvsmtp1.octopuce.fr X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) 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.4 (--) In Emacs 29.0.50 master, the command rmail-forward always generates an error. To reproduce, open any Rmail file with rmail and type "f". Debugger entered--Lisp error: (wrong-type-argument stringp nil) string-match("\\`[^ @]+@[^ @]+\\'" nil nil t) message-mail(nil "[nicolas@graner.name: testing]" ((In-Reply-To) ("cc")) nil nil (rmail-yank-current-message #) ((rmail-mark-message # (1) 5)) (rmail-mail-return #)) compose-mail(nil "[nicolas@graner.name: testing]" ((In-Reply-To) ("cc")) nil nil (rmail-yank-current-message #) ((rmail-mark-message # (1) 5)) (rmail-mail-return #)) rmail-start-mail(nil nil "[nicolas@graner.name: testing]" nil nil # ((rmail-mark-message # (1) 5)) t) rmail-forward(nil) funcall-interactively(rmail-forward nil) call-interactively(rmail-forward nil nil) command-execute(rmail-forward) Explanation: In message-mail, code was added to fix incorrect In-Reply-To headers sent by Firefox. This code assumes that the value of the header is a string, but in messages generated by rmail-forward, the value of In-Reply-To is nil. Suggested patch: diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 24cba97718..3bbd68bdcd 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -7034,6 +7034,7 @@ message-mail ;; Firefox sends us In-Reply-To headers that are Message-IDs ;; without <> around them. Fix that. (when (and (eq (car h) 'In-Reply-To) + (stringp (cdr h)) ;; Looks like a Message-ID. (string-match-p "\\`[^ @]+@[^ @]+\\'" (cdr h)) (not (string-match-p "\\`<.*>\\'" (cdr h)))) From unknown Sun Aug 17 00:58:51 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Nicolas Graner Subject: bug#59007: closed (Re: bug#59007: rmail-forward generates wrong-type-argument error) Message-ID: References: <8335ax4njb.fsf@gnu.org> <87v8nv4sjs.fsf@universite-paris-saclay.fr> X-Gnu-PR-Message: they-closed 59007 X-Gnu-PR-Package: emacs Reply-To: 59007@debbugs.gnu.org Date: Sat, 05 Nov 2022 12:03:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1667649782-17858-1" This is a multi-part message in MIME format... ------------=_1667649782-17858-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #59007: rmail-forward generates wrong-type-argument error which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 59007@debbugs.gnu.org. --=20 59007: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D59007 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1667649782-17858-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 59007-done) by debbugs.gnu.org; 5 Nov 2022 12:02:48 +0000 Received: from localhost ([127.0.0.1]:55798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1orHsu-0004dc-0B for submit@debbugs.gnu.org; Sat, 05 Nov 2022 08:02:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37196) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1orHso-0004dM-Jt for 59007-done@debbugs.gnu.org; Sat, 05 Nov 2022 08:02:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orHsi-0000N2-AJ; Sat, 05 Nov 2022 08:02:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=emUM8dUntj+JsT1I9RgYw0qhnoi0Rd0QkKH/3ar3eJ0=; b=iFLoCUSUvoyF 4x8wDH59H9fXtXp/nEr5Ja32Mrg1osmQiVDV/aGV/KGrX1bsi5GY5MWBzqvqdGGXdjRFMSkXHkZrI 546e8RokG5gNkNOWhiE59MlSgWQ1URGS6tMe29VE1DT+CZYsAaHFze1kZQ0KvzFDl38u6eCfEvM0a Wj3Q+7FbrAZ6DARiWP7JFf8boTv6BPyUwy4owyqXEh0hhd22L0zET9vZa0eX4yGesLw+hG20I4tdS 7/UFRs6S/FGLKEdwhq3P4MFAkvdNko04dkS+jbSAGkXCfG0NXMgprUOUNvqce3aN8D/AqL2cSPLRu QYlVho0WMoUEj5a1KP2CSA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orHsh-0001l8-NA; Sat, 05 Nov 2022 08:02:36 -0400 Date: Sat, 05 Nov 2022 14:02:32 +0200 Message-Id: <8335ax4njb.fsf@gnu.org> From: Eli Zaretskii To: Nicolas Graner In-Reply-To: <87v8nv4sjs.fsf@universite-paris-saclay.fr> (message from Nicolas Graner on Thu, 03 Nov 2022 22:49:43 +0100) Subject: Re: bug#59007: rmail-forward generates wrong-type-argument error References: <87v8nv4sjs.fsf@universite-paris-saclay.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59007-done Cc: 59007-done@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: -3.3 (---) > From: Nicolas Graner > Date: Thu, 03 Nov 2022 22:49:43 +0100 > > In Emacs 29.0.50 master, the command rmail-forward always generates an > error. > > To reproduce, open any Rmail file with rmail and type "f". > > Debugger entered--Lisp error: (wrong-type-argument stringp nil) > string-match("\\`[^ @]+@[^ @]+\\'" nil nil t) > message-mail(nil "[nicolas@graner.name: testing]" ((In-Reply-To) ("cc")) nil nil (rmail-yank-current-message #) ((rmail-mark-message # (1) 5)) (rmail-mail-return #)) > compose-mail(nil "[nicolas@graner.name: testing]" ((In-Reply-To) ("cc")) nil nil (rmail-yank-current-message #) ((rmail-mark-message # (1) 5)) (rmail-mail-return #)) > rmail-start-mail(nil nil "[nicolas@graner.name: testing]" nil nil # ((rmail-mark-message # (1) 5)) t) > rmail-forward(nil) > funcall-interactively(rmail-forward nil) > call-interactively(rmail-forward nil nil) > command-execute(rmail-forward) > > Explanation: > > In message-mail, code was added to fix incorrect In-Reply-To headers > sent by Firefox. This code assumes that the value of the header is a > string, but in messages generated by rmail-forward, the value of > In-Reply-To is nil. > > Suggested patch: Thanks, installed. ------------=_1667649782-17858-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 3 Nov 2022 21:50:00 +0000 Received: from localhost ([127.0.0.1]:50943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqi63-0000HG-Ry for submit@debbugs.gnu.org; Thu, 03 Nov 2022 17:50:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:60828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqi5z-0000H4-Ip for submit@debbugs.gnu.org; Thu, 03 Nov 2022 17:49:58 -0400 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 1oqi5z-00042N-Dw for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 17:49:55 -0400 Received: from ouvsmtp1.octopuce.fr ([194.36.166.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqi5x-0001XY-05 for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 17:49:54 -0400 Received: from panel.vitry.ouvaton.coop (unknown [194.36.166.20]) by ouvsmtp1.octopuce.fr (Postfix) with ESMTPS id 2FD121E8 for ; Thu, 3 Nov 2022 22:49:45 +0100 (CET) Received: from hypra-graner (215.124.67.86.rev.sfr.net [86.67.124.215]) by panel.vitry.ouvaton.coop (Postfix) with ESMTPSA id CAE395E1764 for ; Thu, 3 Nov 2022 22:49:44 +0100 (CET) From: Nicolas Graner To: bug-gnu-emacs@gnu.org Subject: rmail-forward generates wrong-type-argument error Date: Thu, 03 Nov 2022 22:49:43 +0100 Message-ID: <87v8nv4sjs.fsf@universite-paris-saclay.fr> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=194.36.166.50; envelope-from=nicolas@graner.name; helo=ouvsmtp1.octopuce.fr X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) 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.4 (--) In Emacs 29.0.50 master, the command rmail-forward always generates an error. To reproduce, open any Rmail file with rmail and type "f". Debugger entered--Lisp error: (wrong-type-argument stringp nil) string-match("\\`[^ @]+@[^ @]+\\'" nil nil t) message-mail(nil "[nicolas@graner.name: testing]" ((In-Reply-To) ("cc")) nil nil (rmail-yank-current-message #) ((rmail-mark-message # (1) 5)) (rmail-mail-return #)) compose-mail(nil "[nicolas@graner.name: testing]" ((In-Reply-To) ("cc")) nil nil (rmail-yank-current-message #) ((rmail-mark-message # (1) 5)) (rmail-mail-return #)) rmail-start-mail(nil nil "[nicolas@graner.name: testing]" nil nil # ((rmail-mark-message # (1) 5)) t) rmail-forward(nil) funcall-interactively(rmail-forward nil) call-interactively(rmail-forward nil nil) command-execute(rmail-forward) Explanation: In message-mail, code was added to fix incorrect In-Reply-To headers sent by Firefox. This code assumes that the value of the header is a string, but in messages generated by rmail-forward, the value of In-Reply-To is nil. Suggested patch: diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 24cba97718..3bbd68bdcd 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -7034,6 +7034,7 @@ message-mail ;; Firefox sends us In-Reply-To headers that are Message-IDs ;; without <> around them. Fix that. (when (and (eq (car h) 'In-Reply-To) + (stringp (cdr h)) ;; Looks like a Message-ID. (string-match-p "\\`[^ @]+@[^ @]+\\'" (cdr h)) (not (string-match-p "\\`<.*>\\'" (cdr h)))) ------------=_1667649782-17858-1--