I configured mbsync, msmtp, notmuch, notmuch.el message.el and org-msg.el to receive and send email with 4 different email account from Emacs notmuch MUA.
When I reply to an email the composer automatically has from:
populated with user3
email, even if user1
, user2
or user4
received the email.
How could I configure Emacs, so when I reply to an email received by user1
, from:
shows user1
email, when I reply to an email received by user2
, from:
shows user2
email, etc.?
Here is my config:
MUA
notmuch
notmuch
(use-package notmuch
:load-path "/usr/share/emacs/site-lisp/"
:custom
(notmuch-show-logo nil)
(notmuch-hello-auto-refresh t)
(notmuch-hello-recent-searches-max 5)
(notmuch-search-oldest-first nil)
(notmuch-draft-folder "Drafts")
;; Tags
(notmuch-show-all-tags-list t)
(notmuch-message-replied-tags '("+replied"))
(notmuch-message-forwarded-tags '("+forwarded"))
(notmuch-show-mark-read-tags '("-unread"))
(notmuch-draft-tags '("+draft"))
;; Searches
(notmuch-saved-searches
`(
(:name "📥 unread" :query "tag:unread" :key "u")
(:name "💬 sent" :query "path:gmail-user1/[Gmail]/Messages envoy&AOk-s/** path:gmail-user2/[Gmail]/Messages envoy&AOk-s/** or path:gmail-user4/[Gmail]/Messages envoy&AOk-s/** or path:free-user3/Sent/** or path:gmx-user1/Sent/**" :key "s")
(:name "all mail" :query "*" :key "a")
))
;; Sent emails
(notmuch-always-prompt-for-sender t)
(notmuch-identities
'(
("user1 <[email protected]>")
("user3 <[email protected]>")
("user4 <[email protected]>")
("user2 <[email protected]>")
("user1 <[email protected]>")
))
(notmuch-fcc-dirs
'(
("[email protected]" . "gmx-user1/Sent")
("[email protected]" . "free-user3/Sent")
("[email protected]" . "gmail-user4/[Gmail]/Messages envoy&AOk-s")
("[email protected]" . "gmail-user2/[Gmail]/Messages envoy&AOk-s")
("[email protected]" . "gmail-user1/[Gmail]/Messages envoy&AOk-s")
)
)
;; Keybindings
:bind
("C-x m" . notmuch-mua-new-mail)
(:map org-msg-edit-mode-map
("C-s" . notmuch-draft-save))
)
notmuch-transient
(use-package notmuch-transient
:after (transient notmuch)
)
Sending
org-msg
(use-package org-msg
:custom
(mail-user-agent 'notmuch-user-agent)
(org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil \\n:t")
(org-msg-default-alternatives '((new . (text html))
(reply-to-html . (text html))
(reply-to-text . (text)))
)
(org-msg-convert-citation t)
:config
(org-msg-mode 1)
)
message
(MUA agnostic)
(use-package message
:ensure nil
:custom
(message-default-mail-headers "Cc: \nBcc: \n")
(message-sendmail-envelope-from 'header)
(message-kill-buffer-on-exit t)
(sendmail-program "/usr/bin/msmtp")
(send-mail-function 'sendmail-send-it)
)