From a9495f7be55621cfbc9b646564717cead77055a3 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sat, 18 May 2024 00:14:22 +0300 Subject: [PATCH] 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. --- mu4e/mu4e-draft.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mu4e/mu4e-draft.el b/mu4e/mu4e-draft.el index 1a5e015e..12834580 100644 --- a/mu4e/mu4e-draft.el +++ b/mu4e/mu4e-draft.el @@ -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.