Set context-aware "from" address (mu4e)

The user can configure a list of addresses that are associated with a
context by passing a list to set-email-account!, e.g.

    (set-email-account! "foo"
      ...
      (+mu4e-personal-addresses ("foo@bar.org" "bar@baz.org")))

This list, if it exists, is used to prompt the user for the "from"
address after trying to set the "from" address automatically.
This commit is contained in:
TEC 2020-10-13 16:49:09 +02:00
parent 522c1ca33b
commit a8d7d61e44
No known key found for this signature in database
GPG key ID: 779591AFDB81F06C
2 changed files with 16 additions and 7 deletions

View file

@ -3,6 +3,9 @@
(defvar +mu4e-backend 'mbsync
"Which backend to use. Can either be offlineimap, mbsync or nil (manual).")
(defvar +mu4e-personal-adresses 'nil
"Alternative to mu4e-personal-adresses that can be set for each account (mu4e context).")
;;
;;; Packages
@ -188,7 +191,7 @@
:v "u" #'mu4e-headers-mark-for-unmark
:vn "l" #'+mu4e-msg-to-agenda))
(add-hook 'mu4e-compose-pre-hook '+mu4e-set-account)
(add-hook 'mu4e-compose-pre-hook '+mu4e-set-from-address)
(advice-add #'mu4e~main-action-str :override #'+mu4e~main-action-str-prettier)
(when (featurep! :editor evil)