If you ever tried to setup mutt? You might encountered problems with all the configuration stuff which is needed to setup mutt properly. For a long time I’ve been searching a solution for viewing emails remotely. That’s why I give mutt another chance, to prove its greatness.
As already mentioned the most tedious part of using mutt is to grasp the configuration which is needed to bring mutt in a state where it is running fine. What I wanted to configure:
- Multiple email accounts with same host using native imap/smpt support of mutt
- Gpg support for each account
passto store passwords
- A usable theme
My folder structure looks like:
~/.mutt |- muttrc |- acc.account1 |- acc.account2 |- cache | ...mutt generated header cache... |- colors |- mutt-colors-blue.muttrc
Before we setup gpg, pass and multi accounts we setup the basic configurations:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
Fortunately now days most distributions already come with a handy configuration which makes configuring mutt really easy. In my case (Archlinux) it was just adding
Password manager pass
I use pass as password manager.
To get a password into mutt a custom variable per password is needed. (Beware mutt only allows user variables starting with
For each password I added
set my_pass_acc1=`pass email/example/acc1`
~/.mutt/muttrc. This will make that pass is invoked on startup which will ask you the encryption password once.
To set up multiple accounts we need to add an account and a folder
Hook. For each account we setup a key binding to select the email account, an
account-hook to set user name and password (and extra configuration) and a
folder-hook to load configurations from a separate file.
For each account you want to add put this into your
macro index,pager <f5> "<change-folder>imaps://firstname.lastname@example.org<enter>" account-hook imaps://email@example.com/* "set imap_user="acc1" imap_pass=$$my_pass_acc1" folder-hook imaps://firstname.lastname@example.org/* 'source ~/.mutt/acc.acc1'
and create a configuration for each account which will be sourced by
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
smpt_url follow this syntax:
SSL: [imaps|smtps]://user@server:<port>/<imapfolder> NON SSL or activated via options: [imap|smtp]://user@server:<port>/<imapfolder>
Because I already set
msmpt in my
~/.mutt/muttrc it worked flawless only settings smpt settings in my
NOTE: You need to set
envelope_form to yes to make
Nice now mutt works with multiple accounts + imap + smpt + pass password manager!
At the end: I use a nice blue mutt theme from here.