mu4e-draft: use message-alternative-emails for replies

Set message-alternative-emails to the special
`mu4e-personal-or-alternative-address-p' such that it honors both
user-specified alternative address as well as the mu personal addresses.

Fixes #2708.
This commit is contained in:
Dirk-Jan C. Binnema 2024-05-18 00:14:22 +03:00
parent 3ff2f9f1ac
commit a9495f7be5
1 changed files with 8 additions and 1 deletions

View File

@ -514,7 +514,14 @@ while in a buffer with the to-be-forwarded/replied-to message."
(let* ((message-this-is-mail t)
(message-generate-headers-first nil)
(message-newsreader mu4e-user-agent-string)
(message-mail-user-agent nil))
(message-mail-user-agent nil)
(mam message-alternative-emails)
(message-alternative-emails
(lambda (addr)
(or (mu4e-personal-address-p addr)
(cond
((functionp mam) (funcall mam addr))
((stringp mam) (string-match mam addr)))))))
(cl-letf
;; `message-pop-to-buffer' attempts switching the visible buffer;
;; instead, we manipulate it to _return_ the buffer.