March 24, 2024

Add a second email account to your Mutt, msmtp, mbsync configuration

To add a second email address, I updated my Mutt, msmtp and mbsync configurations with the following:

In .muttrc

I read and updated my config with:

set sendmail ="/usr/bin/msmtp"  # path/to/msmtp
set realname = 'Firstname Surname' 
set use_from = yes
set envelope_from = yes  
set from = 
# I got the following macro from elsewhere; the suggested macro in msmtp doc did not function as expected 
macro compose <esc>1 '<esc>f^UFirstname Surname <><enter>'
macro compose <esc>2 '<esc>f^UFirstname Surname <><enter>'

In .msmtprc

I added:

account email2
port 587
passwordeval "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.config/mutt/password_email2.gpg"

To learn how to store your password encrypted, read the section Store your password in an encrypted file’ of this wiki:

In .mbsyncrc

I added:

IMAPAccount email2
Port 993
PassCmd "gpg -dq $HOME/.config/mutt/password_email2.gpg"
AuthMechs PLAIN 

IMAPStore email2-remote
Account email2
MaildirStore email2-local
SubFolders Verbatim
Path ~/Mail/email2/ # the trailing "/" matters
Inbox ~/Mail/email2/INBOX
Flatten . # useful with Mutt according to mbsync manpage
Channel email2
Far :email2-remote:
Near :email2-local:
SyncState *
Sync All 
Patterns * INBOX
Create Both
Expunge Both

I had to create /Mail/email2:

$ mkdir /Mail/email2


In the email header of the recipient email address, check that the host is the one you expect to be assciated with the host of the From: email address.

Issues I have

macro compose <esc>2 '<esc>f^UFirstname Surname <><enter>'

Firstname Surname does not show up in the name field of the mailbox of the recipient. Instead the recipient sees . I don’t know if I am doing something wrong. I want to try fiddling with the set_from_header on in my .msmtprc.

See also the wiki:


I do self-funded research and I'm writing a book.

> What's the book about?

About technologies and agency.

Meaning, technologies can foster agency. No doubt. But I am also asking:

Can usage of technologies give us a sense of empowerment while in fact undermining our abilities?

I posted a summary of the prologue on the homepage:


personal computing command-line interface (cli) gnu linux trisquel shell literacy office applications wiki mutt msmtp mbsync

No affiliate links, no analytics, no tracking, no cookies. This work © 2016-2024 by is licensed under CC BY-ND 4.0 .   about me   contact me   all entries & tags   FAQ   GPG public key

GPG fingerprint: 2E0F FB60 7FEF 11D0 FB45 4DDC E979 E52A 7036 7A88