all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#64454: 30.0.50; In-Reply-To header obsolete content
@ 2023-07-04  6:11 Andrew Cohen
  2023-07-04  8:53 ` Robert Pluim
  2023-07-04 11:27 ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Andrew Cohen @ 2023-07-04  6:11 UTC (permalink / raw)
  To: 64454


When replying to an email, gnus constructs an In-Reply-To: header that
contains the message-id of the originating email followed by a phrase of
the form:

(User's  message of "Wed, 17 Nov 2021 22:16:04 -0800")

While allowed, the addition of this parenthetical phrase has been made
obsolete as of RFC5322. I suggest removing it, or wrapping it in a
defcustom 'message-strict-rfc5322. Any preferences?

-- 
Andrew Cohen





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#64454: 30.0.50; In-Reply-To header obsolete content
  2023-07-04  6:11 bug#64454: 30.0.50; In-Reply-To header obsolete content Andrew Cohen
@ 2023-07-04  8:53 ` Robert Pluim
  2023-09-16 23:51   ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-04 11:27 ` Eli Zaretskii
  1 sibling, 1 reply; 7+ messages in thread
From: Robert Pluim @ 2023-07-04  8:53 UTC (permalink / raw)
  To: Andrew Cohen; +Cc: 64454

>>>>> On Tue, 04 Jul 2023 14:11:35 +0800, Andrew Cohen <acohen@ust.hk> said:

    Andrew> When replying to an email, gnus constructs an In-Reply-To: header that
    Andrew> contains the message-id of the originating email followed by a phrase of
    Andrew> the form:

    Andrew> (User's  message of "Wed, 17 Nov 2021 22:16:04 -0800")

    Andrew> While allowed, the addition of this parenthetical phrase has been made
    Andrew> obsolete as of RFC5322. I suggest removing it, or wrapping it in a
    Andrew> defcustom 'message-strict-rfc5322. Any preferences?

Iʼd remove it, document its removal, but have a defcustom to get it
back.

Robert
-- 





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#64454: 30.0.50; In-Reply-To header obsolete content
  2023-07-04  6:11 bug#64454: 30.0.50; In-Reply-To header obsolete content Andrew Cohen
  2023-07-04  8:53 ` Robert Pluim
@ 2023-07-04 11:27 ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2023-07-04 11:27 UTC (permalink / raw)
  To: Andrew Cohen; +Cc: 64454

> From: Andrew Cohen <acohen@ust.hk>
> Date: Tue, 04 Jul 2023 14:11:35 +0800
> 
> 
> When replying to an email, gnus constructs an In-Reply-To: header that
> contains the message-id of the originating email followed by a phrase of
> the form:
> 
> (User's  message of "Wed, 17 Nov 2021 22:16:04 -0800")
> 
> While allowed, the addition of this parenthetical phrase has been made
> obsolete as of RFC5322. I suggest removing it, or wrapping it in a
> defcustom 'message-strict-rfc5322. Any preferences?

If you decide to remove it, please make that conditional on a
defcustom, so that interested users will have a way to get back old
behavior, when they need that.

Thanks.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#64454: 30.0.50; In-Reply-To header obsolete content
  2023-07-04  8:53 ` Robert Pluim
@ 2023-09-16 23:51   ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-18  9:59     ` Robert Pluim
  0 siblings, 1 reply; 7+ messages in thread
From: Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-16 23:51 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Andrew Cohen, 64454

Robert Pluim <rpluim@gmail.com> writes:

>>>>>> On Tue, 04 Jul 2023 14:11:35 +0800, Andrew Cohen <acohen@ust.hk> said:
>
>     Andrew> When replying to an email, gnus constructs an In-Reply-To: header that
>     Andrew> contains the message-id of the originating email followed by a phrase of
>     Andrew> the form:
>
>     Andrew> (User's  message of "Wed, 17 Nov 2021 22:16:04 -0800")
>
>     Andrew> While allowed, the addition of this parenthetical phrase has been made
>     Andrew> obsolete as of RFC5322. I suggest removing it, or wrapping it in a
>     Andrew> defcustom 'message-strict-rfc5322. Any preferences?
>
> Iʼd remove it, document its removal, but have a defcustom to get it
> back.
>
> Robert

Could it still be relevant when interacting with clients that confirm to
that rfc?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#64454: 30.0.50; In-Reply-To header obsolete content
  2023-09-16 23:51   ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-18  9:59     ` Robert Pluim
  2025-02-04  1:50       ` Andrew Cohen
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Pluim @ 2023-09-18  9:59 UTC (permalink / raw)
  To: Björn Bidar; +Cc: Andrew Cohen, 64454

>>>>> On Sun, 17 Sep 2023 02:51:00 +0300, Björn Bidar <bjorn.bidar@thaodan.de> said:

    Björn> Robert Pluim <rpluim@gmail.com> writes:
    >>>>>>> On Tue, 04 Jul 2023 14:11:35 +0800, Andrew Cohen <acohen@ust.hk> said:
    >> 
    Andrew> When replying to an email, gnus constructs an In-Reply-To: header that
    Andrew> contains the message-id of the originating email followed by a phrase of
    Andrew> the form:
    >> 
    Andrew> (User's  message of "Wed, 17 Nov 2021 22:16:04 -0800")
    >> 
    Andrew> While allowed, the addition of this parenthetical phrase has been made
    Andrew> obsolete as of RFC5322. I suggest removing it, or wrapping it in a
    Andrew> defcustom 'message-strict-rfc5322. Any preferences?
    >> 
    >> Iʼd remove it, document its removal, but have a defcustom to get it
    >> back.
    >> 
    >> Robert

    Björn> Could it still be relevant when interacting with clients that confirm to
    Björn> that rfc?

I donʼt see how: that RFC makes that phrasing obsolete, so there will
no doubt be a client that at some point interprets the header
strictly, in which you donʼt want to be outputting the old format, so
we should output the new one by default.

Robert
-- 





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#64454: 30.0.50; In-Reply-To header obsolete content
  2023-09-18  9:59     ` Robert Pluim
@ 2025-02-04  1:50       ` Andrew Cohen
  2025-02-04  9:00         ` Robert Pluim
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cohen @ 2025-02-04  1:50 UTC (permalink / raw)
  To: 64454; +Cc: Robert Pluim

I fixed this in my tree but never got around to pushing the result. I'll
push the following unless there are changes that are needed.

Best,
Andy

da900f025e9ed5e8d0e5aa9fb6bf9f5d54436c6c
Author:     Andrew G Cohen <cohen@andy.bu.edu>
AuthorDate: Wed Jul 5 15:21:16 2023 +0800
Commit:     Andrew G Cohen <cohen@andy.bu.edu>
CommitDate: Tue Feb 4 09:45:29 2025 +0800

Parent:     2dc8c54341e Fix crashes on XI devices being disabled (bug#75870)
Merged:     master
Contained:  feature/igc
Follows:    emacs-29.1.90 (176367)

Don't use obsolete In-Reply-To header format in messages

When creating a new message, message-send-mail uses an obsolete format
for the In-Reply-To header that includes additional information about
the originating message.  This patch changes the default to use the
rfc5322 approved format, but allow the obsolete format through a
defcustom.

* lisp/gnus/message.el (message-make-in-reply-to): Return only the
message-id of the originating message (the default) unless the new
custom variable message-header-use-obsolete-in-reply-to is non-nil.
* doc/misc/message.texi: Document the new custom variable
message-header-use-obsolete-in-reply-to.

2 files changed, 44 insertions(+), 28 deletions(-)
doc/misc/message.texi |  6 +++++
lisp/gnus/message.el  | 66 +++++++++++++++++++++++++++++----------------------

modified   doc/misc/message.texi
@@ -1791,6 +1791,12 @@ Message Headers
 @code{message-carefully-insert-headers} will not insert a @code{To}
 header when the message is already @code{CC}ed to the recipient.
 
+@item message-header-use-obsolete-in-reply-to
+@vindex message-header-use-obsolete-in-reply-to
+Use an obsolete form of the @code{In-Reply-To} header that includes a
+parenthetical phrase with details of the originating email following
+the message id.  The default is @code{nil}.
+
 @item message-syntax-checks
 @vindex message-syntax-checks
 Controls what syntax checks should not be performed on outgoing posts.
modified   lisp/gnus/message.el
@@ -113,6 +113,13 @@ message-faces
   :group 'message
   :group 'faces)
 
+(defcustom message-header-use-obsolete-in-reply-to nil
+  "Include extra information in the In-Reply-To header (this form
+has been obsolete since RFC 2822.)"
+  :group 'message-headers
+  :version "31.1"
+  :type 'boolean)
+
 (defcustom message-directory "~/Mail/"
   "Directory from which all other mail file variables are derived."
   :group 'message-various
@@ -5993,35 +6000,38 @@ message-make-in-reply-to
   "Return the In-Reply-To header for this message."
   (when message-reply-headers
     (let ((from (mail-header-from message-reply-headers))
-	  (date (mail-header-date message-reply-headers))
-	  (msg-id (mail-header-id message-reply-headers)))
+          (date (mail-header-date message-reply-headers))
+          (msg-id (mail-header-id message-reply-headers)))
       (when from
-	(let ((name (mail-extract-address-components from)))
-	  (concat
-	   msg-id (if msg-id " (")
-	   (if (car name)
-	       (if (string-match "[^[:ascii:]]" (car name))
-		   ;; Quote a string containing non-ASCII characters.
-		   ;; It will make the RFC2047 encoder cause an error
-		   ;; if there are special characters.
-                   (mm-with-multibyte-buffer
-                     (insert (car name))
-                     (goto-char (point-min))
-                     (while (search-forward "\"" nil t)
-                       (when (prog2
-                                 (backward-char)
-                                 (zerop (% (skip-chars-backward "\\\\") 2))
-                               (goto-char (match-beginning 0)))
-                         (insert "\\"))
-                       (forward-char))
-                     ;; Those quotes will be removed by the RFC2047 encoder.
-                     (concat "\"" (buffer-string) "\""))
-		 (car name))
-	     (nth 1 name))
-	   "'s message of \""
-	   (if (or (not date) (string= date ""))
-	       "(unknown date)" date)
-	   "\"" (if msg-id ")")))))))
+        (let ((name (mail-extract-address-components from)))
+          (concat
+           msg-id
+           (when message-header-use-obsolete-in-reply-to
+             (concat
+              (if msg-id " (")
+              (if (car name)
+                  (if (string-match "[^[:ascii:]]" (car name))
+                      ;; Quote a string containing non-ASCII characters.
+                      ;; It will make the RFC2047 encoder cause an error
+                      ;; if there are special characters.
+                      (mm-with-multibyte-buffer
+                        (insert (car name))
+                        (goto-char (point-min))
+                        (while (search-forward "\"" nil t)
+                          (when (prog2
+                                    (backward-char)
+                                    (zerop (% (skip-chars-backward "\\\\") 2))
+                                  (goto-char (match-beginning 0)))
+                            (insert "\\"))
+                          (forward-char))
+                        ;; Those quotes will be removed by the RFC2047 encoder.
+                        (concat "\"" (buffer-string) "\""))
+                    (car name))
+                (nth 1 name))
+              "'s message of \""
+              (if (or (not date) (string= date ""))
+                  "(unknown date)" date)
+              "\"" (if msg-id ")")))))))))
 
 (defun message-make-distribution ()
   "Make a Distribution header."



-- 
Andrew Cohen





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#64454: 30.0.50; In-Reply-To header obsolete content
  2025-02-04  1:50       ` Andrew Cohen
@ 2025-02-04  9:00         ` Robert Pluim
  0 siblings, 0 replies; 7+ messages in thread
From: Robert Pluim @ 2025-02-04  9:00 UTC (permalink / raw)
  To: Andrew Cohen; +Cc: 64454

>>>>> On Tue, 04 Feb 2025 09:50:55 +0800, Andrew Cohen <acohen@ust.hk> said:

    Andrew> I fixed this in my tree but never got around to pushing the result. I'll
    Andrew> push the following unless there are changes that are needed.

Only minor comments below.

    Andrew> Best,
    Andrew> Andy

    Andrew> da900f025e9ed5e8d0e5aa9fb6bf9f5d54436c6c
    Andrew> Author:     Andrew G Cohen <cohen@andy.bu.edu>
    Andrew> AuthorDate: Wed Jul 5 15:21:16 2023 +0800
    Andrew> Commit:     Andrew G Cohen <cohen@andy.bu.edu>
    Andrew> CommitDate: Tue Feb 4 09:45:29 2025 +0800

    Andrew> Parent:     2dc8c54341e Fix crashes on XI devices being disabled (bug#75870)
    Andrew> Merged:     master
    Andrew> Contained:  feature/igc
    Andrew> Follows:    emacs-29.1.90 (176367)

    Andrew> Don't use obsolete In-Reply-To header format in messages

    Andrew> When creating a new message, message-send-mail uses an obsolete format
    Andrew> for the In-Reply-To header that includes additional information about
    Andrew> the originating message.  This patch changes the default to use the
    Andrew> rfc5322 approved format, but allow the obsolete format through a
    Andrew> defcustom.

    Andrew> * lisp/gnus/message.el (message-make-in-reply-to): Return only the
    Andrew> message-id of the originating message (the default) unless the new
    Andrew> custom variable message-header-use-obsolete-in-reply-to is non-nil.
    Andrew> * doc/misc/message.texi: Document the new custom variable
    Andrew> message-header-use-obsolete-in-reply-to.

This new user option, its default value, and the behaviour change
should be documented in NEWS

Also please put (Bug#64454) somewhere in the commit message

    Andrew> 2 files changed, 44 insertions(+), 28 deletions(-)
    Andrew> doc/misc/message.texi |  6 +++++
    Andrew> lisp/gnus/message.el  | 66 +++++++++++++++++++++++++++++----------------------

    Andrew> modified   doc/misc/message.texi
    Andrew> @@ -1791,6 +1791,12 @@ Message Headers
    Andrew>  @code{message-carefully-insert-headers} will not insert a @code{To}
    Andrew>  header when the message is already @code{CC}ed to the recipient.
 
    Andrew> +@item message-header-use-obsolete-in-reply-to
    Andrew> +@vindex message-header-use-obsolete-in-reply-to
    Andrew> +Use an obsolete form of the @code{In-Reply-To} header that includes a
    Andrew> +parenthetical phrase with details of the originating email following
    Andrew> +the message id.  The default is @code{nil}.
    Andrew> +

"When non-@code{nil}, " or similar

    Andrew>  @item message-syntax-checks
    Andrew>  @vindex message-syntax-checks
    Andrew>  Controls what syntax checks should not be performed on outgoing posts.
    Andrew> modified   lisp/gnus/message.el
    Andrew> @@ -113,6 +113,13 @@ message-faces
    Andrew>    :group 'message
    Andrew>    :group 'faces)
 
    Andrew> +(defcustom message-header-use-obsolete-in-reply-to nil
    Andrew> +  "Include extra information in the In-Reply-To header (this form
    Andrew> +has been obsolete since RFC 2822.)"
    Andrew> +  :group 'message-headers
    Andrew> +  :version "31.1"
    Andrew> +  :type 'boolean)
    Andrew> +

The first sentence of the docstring should fit on a single line. The
reference to RFC 2822 can go in the body

    Andrew>  (defcustom message-directory "~/Mail/"
    Andrew>    "Directory from which all other mail file variables are derived."
    Andrew>    :group 'message-various
    Andrew> @@ -5993,35 +6000,38 @@ message-make-in-reply-to
    Andrew>    "Return the In-Reply-To header for this message."
    Andrew>    (when message-reply-headers
    Andrew>      (let ((from (mail-header-from message-reply-headers))
    Andrew> -	  (date (mail-header-date message-reply-headers))
    Andrew> -	  (msg-id (mail-header-id message-reply-headers)))
    Andrew> +          (date (mail-header-date message-reply-headers))
    Andrew> +          (msg-id (mail-header-id
    Andrew>    message-reply-headers)))

Ah, the side-effects of `indent-tabs-mode' being nil for
`emacs-lisp-mode' now 🙂 (no change needed)

Robert
-- 





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-02-04  9:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-04  6:11 bug#64454: 30.0.50; In-Reply-To header obsolete content Andrew Cohen
2023-07-04  8:53 ` Robert Pluim
2023-09-16 23:51   ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-18  9:59     ` Robert Pluim
2025-02-04  1:50       ` Andrew Cohen
2025-02-04  9:00         ` Robert Pluim
2023-07-04 11:27 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.