diff options
| author | Andrew G Cohen | 2023-07-05 15:21:16 +0800 |
|---|---|---|
| committer | Andrew G Cohen | 2025-02-04 21:13:59 +0800 |
| commit | 2eb6171ec96eac0c78cf20b3003fcbcb1206c8c7 (patch) | |
| tree | a5ed122eee6c98b3e66b95e358e786412bf43610 | |
| parent | 40e38a681dafb02f71d741338e9c3c5ff99c734e (diff) | |
| download | emacs-2eb6171ec96eac0c78cf20b3003fcbcb1206c8c7.tar.gz emacs-2eb6171ec96eac0c78cf20b3003fcbcb1206c8c7.zip | |
Don't use obsolete In-Reply-To format in messages (Bug#64454)
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.
* etc/NEWS: Update NEWS.
| -rw-r--r-- | doc/misc/message.texi | 6 | ||||
| -rw-r--r-- | etc/NEWS | 10 | ||||
| -rw-r--r-- | lisp/gnus/message.el | 66 |
3 files changed, 54 insertions, 28 deletions
diff --git a/doc/misc/message.texi b/doc/misc/message.texi index bd20aec5bc6..509bbd5b575 100644 --- a/doc/misc/message.texi +++ b/doc/misc/message.texi | |||
| @@ -1791,6 +1791,12 @@ member list with elements @code{CC} and @code{To}, then | |||
| 1791 | @code{message-carefully-insert-headers} will not insert a @code{To} | 1791 | @code{message-carefully-insert-headers} will not insert a @code{To} |
| 1792 | header when the message is already @code{CC}ed to the recipient. | 1792 | header when the message is already @code{CC}ed to the recipient. |
| 1793 | 1793 | ||
| 1794 | @item message-header-use-obsolete-in-reply-to | ||
| 1795 | @vindex message-header-use-obsolete-in-reply-to | ||
| 1796 | When non-@code{nil}, use an obsolete form of the @code{In-Reply-To} | ||
| 1797 | header that includes a parenthetical phrase with details of the | ||
| 1798 | originating email following the message id. The default is @code{nil}. | ||
| 1799 | |||
| 1794 | @item message-syntax-checks | 1800 | @item message-syntax-checks |
| 1795 | @vindex message-syntax-checks | 1801 | @vindex message-syntax-checks |
| 1796 | Controls what syntax checks should not be performed on outgoing posts. | 1802 | Controls what syntax checks should not be performed on outgoing posts. |
| @@ -484,6 +484,16 @@ If 'save-place-autosave-interval' is nil, auto saving is disabled; this | |||
| 484 | is the default. As before, saved places are scheduled to be saved at | 484 | is the default. As before, saved places are scheduled to be saved at |
| 485 | Emacs exit. | 485 | Emacs exit. |
| 486 | 486 | ||
| 487 | ** Message | ||
| 488 | |||
| 489 | --- | ||
| 490 | *** In-Reply-To header contains only a message id. | ||
| 491 | The In-Reply-To header created when replying to a message now contains | ||
| 492 | only the originating message's id, conforming to RFC5322. The previous | ||
| 493 | behavior included additional information about the originating message. | ||
| 494 | The new variable 'message-header-use-obsolete-in-reply-to', nil by | ||
| 495 | default, can be set to a non-nil value to restore the previous behavior. | ||
| 496 | |||
| 487 | ** Gnus | 497 | ** Gnus |
| 488 | 498 | ||
| 489 | --- | 499 | --- |
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index b552b211eb8..7a84d6366db 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el | |||
| @@ -113,6 +113,13 @@ | |||
| 113 | :group 'message | 113 | :group 'message |
| 114 | :group 'faces) | 114 | :group 'faces) |
| 115 | 115 | ||
| 116 | (defcustom message-header-use-obsolete-in-reply-to nil | ||
| 117 | "Include extra information in the In-Reply-To header. | ||
| 118 | This form has been obsolete since RFC 2822." | ||
| 119 | :group 'message-headers | ||
| 120 | :version "31.1" | ||
| 121 | :type 'boolean) | ||
| 122 | |||
| 116 | (defcustom message-directory "~/Mail/" | 123 | (defcustom message-directory "~/Mail/" |
| 117 | "Directory from which all other mail file variables are derived." | 124 | "Directory from which all other mail file variables are derived." |
| 118 | :group 'message-various | 125 | :group 'message-various |
| @@ -5993,35 +6000,38 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'." | |||
| 5993 | "Return the In-Reply-To header for this message." | 6000 | "Return the In-Reply-To header for this message." |
| 5994 | (when message-reply-headers | 6001 | (when message-reply-headers |
| 5995 | (let ((from (mail-header-from message-reply-headers)) | 6002 | (let ((from (mail-header-from message-reply-headers)) |
| 5996 | (date (mail-header-date message-reply-headers)) | 6003 | (date (mail-header-date message-reply-headers)) |
| 5997 | (msg-id (mail-header-id message-reply-headers))) | 6004 | (msg-id (mail-header-id message-reply-headers))) |
| 5998 | (when from | 6005 | (when from |
| 5999 | (let ((name (mail-extract-address-components from))) | 6006 | (let ((name (mail-extract-address-components from))) |
| 6000 | (concat | 6007 | (concat |
| 6001 | msg-id (if msg-id " (") | 6008 | msg-id |
| 6002 | (if (car name) | 6009 | (when message-header-use-obsolete-in-reply-to |
| 6003 | (if (string-match "[^[:ascii:]]" (car name)) | 6010 | (concat |
| 6004 | ;; Quote a string containing non-ASCII characters. | 6011 | (if msg-id " (") |
| 6005 | ;; It will make the RFC2047 encoder cause an error | 6012 | (if (car name) |
| 6006 | ;; if there are special characters. | 6013 | (if (string-match "[^[:ascii:]]" (car name)) |
| 6007 | (mm-with-multibyte-buffer | 6014 | ;; Quote a string containing non-ASCII characters. |
| 6008 | (insert (car name)) | 6015 | ;; It will make the RFC2047 encoder cause an error |
| 6009 | (goto-char (point-min)) | 6016 | ;; if there are special characters. |
| 6010 | (while (search-forward "\"" nil t) | 6017 | (mm-with-multibyte-buffer |
| 6011 | (when (prog2 | 6018 | (insert (car name)) |
| 6012 | (backward-char) | 6019 | (goto-char (point-min)) |
| 6013 | (zerop (% (skip-chars-backward "\\\\") 2)) | 6020 | (while (search-forward "\"" nil t) |
| 6014 | (goto-char (match-beginning 0))) | 6021 | (when (prog2 |
| 6015 | (insert "\\")) | 6022 | (backward-char) |
| 6016 | (forward-char)) | 6023 | (zerop (% (skip-chars-backward "\\\\") 2)) |
| 6017 | ;; Those quotes will be removed by the RFC2047 encoder. | 6024 | (goto-char (match-beginning 0))) |
| 6018 | (concat "\"" (buffer-string) "\"")) | 6025 | (insert "\\")) |
| 6019 | (car name)) | 6026 | (forward-char)) |
| 6020 | (nth 1 name)) | 6027 | ;; Those quotes will be removed by the RFC2047 encoder. |
| 6021 | "'s message of \"" | 6028 | (concat "\"" (buffer-string) "\"")) |
| 6022 | (if (or (not date) (string= date "")) | 6029 | (car name)) |
| 6023 | "(unknown date)" date) | 6030 | (nth 1 name)) |
| 6024 | "\"" (if msg-id ")"))))))) | 6031 | "'s message of \"" |
| 6032 | (if (or (not date) (string= date "")) | ||
| 6033 | "(unknown date)" date) | ||
| 6034 | "\"" (if msg-id ")"))))))))) | ||
| 6025 | 6035 | ||
| 6026 | (defun message-make-distribution () | 6036 | (defun message-make-distribution () |
| 6027 | "Make a Distribution header." | 6037 | "Make a Distribution header." |