mu4e-compose/compose-mail: add brackets for in-reply-to

Seems in some contexts we get them _without_ brackets in other-headers; so let's
fix that up.

Fixes #2273.
This commit is contained in:
Dirk-Jan C. Binnema 2022-06-14 23:12:41 +03:00
parent 48695a1981
commit ff8e0455dc
1 changed files with 9 additions and 5 deletions

View File

@ -858,11 +858,15 @@ buffer buried."
(message-add-header (concat "Subject: " subject "\n"))
;; add any other headers specified
(when other-headers
(dolist (h other-headers other-headers)
(if (symbolp (car h)) (setcar h (symbol-name (car h))))
(message-add-header
(concat (capitalize (car h)) ": " (cdr h) "\n" ))))
(seq-each (lambda(hdr)
(let ((field (capitalize(car hdr))) (value (cdr hdr)))
;; fix in-reply without <>
(when (and (string= field "In-Reply-To")
(string-match-p "\\`[^ @]+@[^ @]+\\'" value)
(not (string-match-p "\\`<.*>\\'" value)))
(setq value (concat "<" value ">")))
(message-add-header (concat (capitalize field) ": " value "\n"))))
other-headers)
;; yank message
(if (bufferp yank-action)