1
0
Fork 0

[emacs] Pick "From:" address in replies from my catchall address

This will pick the "From:" address of the composed message from the
"To:" address the email was originally sent to. E.g. if I received an
email as "example.com@bascht.com", the reply will also be composed by
"example.com@bascht.com".
main
Sebastian Schulze 2021-12-06 14:01:37 +01:00
parent 9b3f492494
commit f587c79a08
Signed by: bascht
GPG Key ID: 5BCB1D3B4D38A35A
1 changed files with 9 additions and 0 deletions

View File

@ -115,6 +115,14 @@
(bascht/switch-spellcheck "de_DE")
(spell-fu-mode))
(defun bascht/mu4e-change-from-to-catchall (msg)
"Set the From address based on the To address of the original message."
(when msg
(setq user-mail-address
(cond
((mu4e-message-contact-field-matches msg :to "bascht.com") (cdr-safe (car-safe (mu4e-message-field msg :to))))
(t user-mail-address)))))
; Disable spell-fu-mode globally
(remove-hook 'text-mode-hook #'spell-fu-mode)
@ -137,6 +145,7 @@
(evil-insert-state)))
(add-hook 'mu4e-compose-pre-hook (lambda ()
(bascht/mu4e-change-from-to-catchall mu4e-compose-parent-message)
(bascht/switch-spellcheck "de_DE")
(evil-insert-state)))
(after! markdown