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")) (message-add-header (concat "Subject: " subject "\n"))
;; add any other headers specified ;; add any other headers specified
(when other-headers (seq-each (lambda(hdr)
(dolist (h other-headers other-headers) (let ((field (capitalize(car hdr))) (value (cdr hdr)))
(if (symbolp (car h)) (setcar h (symbol-name (car h)))) ;; fix in-reply without <>
(message-add-header (when (and (string= field "In-Reply-To")
(concat (capitalize (car h)) ": " (cdr h) "\n" )))) (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 ;; yank message
(if (bufferp yank-action) (if (bufferp yank-action)