GNU bug report logs - #59007
rmail-forward generates wrong-type-argument error

Previous Next

Package: emacs;

Reported by: Nicolas Graner <nicolas <at> graner.name>

Date: Thu, 3 Nov 2022 21:50:01 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#59007: closed (rmail-forward generates wrong-type-argument error)
Date: Sat, 05 Nov 2022 12:03:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 05 Nov 2022 14:02:32 +0200
with message-id <8335ax4njb.fsf <at> gnu.org>
and subject line Re: bug#59007: rmail-forward generates wrong-type-argument error
has caused the debbugs.gnu.org bug report #59007,
regarding rmail-forward generates wrong-type-argument error
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
59007: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59007
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Nicolas Graner <nicolas <at> graner.name>
To: bug-gnu-emacs <at> gnu.org
Subject: rmail-forward generates wrong-type-argument error
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 <at> graner.name: testing]" ((In-Reply-To) ("cc")) nil nil (rmail-yank-current-message #<buffer bug-test>) ((rmail-mark-message #<buffer bug-test> (1) 5)) (rmail-mail-return #<buffer bug-test>))
  compose-mail(nil "[nicolas <at> graner.name: testing]" ((In-Reply-To) ("cc")) nil nil (rmail-yank-current-message #<buffer bug-test>) ((rmail-mark-message #<buffer bug-test> (1) 5)) (rmail-mail-return #<buffer bug-test>))
  rmail-start-mail(nil nil "[nicolas <at> graner.name: testing]" nil nil #<buffer bug-test> ((rmail-mark-message #<buffer bug-test> (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))))


[Message part 3 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Nicolas Graner <nicolas <at> graner.name>
Cc: 59007-done <at> debbugs.gnu.org
Subject: Re: bug#59007: rmail-forward generates wrong-type-argument error
Date: Sat, 05 Nov 2022 14:02:32 +0200
> From: Nicolas Graner <nicolas <at> graner.name>
> 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 <at> graner.name: testing]" ((In-Reply-To) ("cc")) nil nil (rmail-yank-current-message #<buffer bug-test>) ((rmail-mark-message #<buffer bug-test> (1) 5)) (rmail-mail-return #<buffer bug-test>))
>   compose-mail(nil "[nicolas <at> graner.name: testing]" ((In-Reply-To) ("cc")) nil nil (rmail-yank-current-message #<buffer bug-test>) ((rmail-mark-message #<buffer bug-test> (1) 5)) (rmail-mail-return #<buffer bug-test>))
>   rmail-start-mail(nil nil "[nicolas <at> graner.name: testing]" nil nil #<buffer bug-test> ((rmail-mark-message #<buffer bug-test> (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.


This bug report was last modified 2 years and 257 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.