I use Emacs and mu4e
to send mail. I have a mail server with Amazon WorkMail and I set up the information at ~/.authinfo.gpg
. Two domains are in the same region and have the same SMTP server with different usernames. When I send email from the second, it is sent with the credentials from the first which appears at the top of the list.
My code is:
(defvar my-mu4e-account-alist
'(
("Account1"
(mu4e-sent-folder "/Account1/Sent Items")
(mu4e-drafts-folder "/Account1/Drafts")
(mu4e-trash-folder "/Account1/Deleted Items")
(user-mail-address "[email protected]")
(smtpmail-smtp-user "[email protected]")
(smtpmail-stream-type ssl)
(smtpmail-smtp-service 465)
)
("Account2"
(mu4e-sent-folder "/Account2/Sent Items")
(mu4e-drafts-folder "/Account2/Drafts")
(mu4e-trash-folder "/Account2/Deleted Items")
(user-mail-address "[email protected]")
(smtpmail-smtp-server "smtp.mail.eu-west-1.awsapps.com")
(smtpmail-stream-type ssl)
(smtpmail-smtp-service 465)
)
))
How can I force each account to use its own account on the server?