]> git.eshelyaron.com Git - emacs.git/commitdiff
Massage In-Reply-To data in message-mail
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 13 Jun 2022 14:46:14 +0000 (16:46 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 13 Jun 2022 14:46:14 +0000 (16:46 +0200)
* lisp/gnus/message.el (message-mail): Fix up Message-IDs from
Firefox (bug#55926).

lisp/gnus/message.el

index 5936d29c9d181d8f424dea2a516c551230259fd1..6973d8a86b20848eb38a582854cdf976b9adbec9 100644 (file)
@@ -7017,7 +7017,15 @@ is a function used to switch to and display the mail buffer."
        ;; https://lists.gnu.org/r/emacs-devel/2011-01/msg00337.html
        ;; We need to convert any string input, eg from rmail-start-mail.
        (dolist (h other-headers other-headers)
-         (if (stringp (car h)) (setcar h (intern (capitalize (car h)))))))
+         (when (stringp (car h))
+            (setcar h (intern (capitalize (car h)))))
+          ;; Firefox sends us In-Reply-To headers that are Message-IDs
+          ;; without <> around them.  Fix that.
+          (when (and (eq (car h) 'In-Reply-To)
+                     ;; Looks like a Message-ID.
+                     (string-match-p "\\`[^ @]+@[^ @]+\\'" (cdr h))
+                     (not (string-match-p "\\`<.*>\\'" (cdr h))))
+            (setcdr h (concat "<" (cdr h) ">")))))
        yank-action send-actions continue switch-function
        return-action))))