If you haven't read part 1 and want to receive mail, see here!

If you haven't read part 2 and want to send mail, see here!

The totality of configuring mutt is complex, but I want to help provide the basics of configuring a two-account system that can send and receive email. Once you can do that, you can figure out the rest as you explore the program, read the manual, and decide what you like and need. At this point, this isn't particularly different than configuring any other multi-account mutt profile.

Here's a basic .muttrc, containing only the necessary elements for multiple accounts and a few options that I think are nearly essential. There's lots more that could or should be in here for a full-fledged setup, but I don't want to confuse things unnecessarily!

# Who am I?
set realname = "Buckaroo Banzai"
set use_from

# Accounts
folder-hook home 'source ~/.mutt/muttrc.home'
folder-hook work 'source ~/.mutt/muttrc.work'

# Start on home account
source ~/.mutt/muttrc.home

# Mailboxes
set mbox_type = Maildir
set copy
mailboxes ~/mail/home
mailboxes ~/mail/work

This requires two additional files which will be loaded whenever you are in directories which match the regex home and work, which we previously set up to be the locations mbsync delivers mail to. You can call them whatever you want and put wherever you want; putting them in a ~/.mutt directory and calling them muttrc.{home,work} is just the pattern I use.

These set the values for each folder:

# muttrc file for home account

set from = "plugh@xyzzy.org"
set hostname = "xyzzy.org"
set folder = "~/mail/home"
set signature = "~/.signature"
set sendmail = "/usr/bin/msmtp -a home"

set spoolfile = "+Inbox"
set postponed = "+Drafts"
set record = "+Sent"
set mbox = "+Archives/`date +%Y`"
save-hook . "+Archives/%[%Y]"
set trash = "+Trash"

color status green default

and

# muttrc file for work account

set from = "thud@yoyodyne.com"
set hostname = "yoyodyne.com"
set folder = "~/mail/work"
set signature = "~/.signature-work"
set sendmail = "/usr/bin/msmtp -a work"

set spoolfile = "+Inbox"
set postponed = "+Drafts"
set record = "+Sent"
set mbox = "+/Archives/`date +%Y`"
save-hook . "+Archives/%[%Y]"
set trash = "+Trash"

color status blue default

I like changing the status colors to help remind myself where I am — the first color is the color of the text, the second is the color of the background — but this is obviously not necessary.

Unfortunately, even if both accounts technically use the same regex (for example, both use set spoolfile = "+Inbox", "+" being a shortcut for $folder), you can't simply set this once in .muttrc and be done. Mailbox shortcut expansion is done when the file is loaded, not when the regex is evaluated, so setting it once in .muttrc wouldn't allow it to switch between mailboxes when the folder-hook is evaluated.

mutt's default save behavior is to append to $mbox without sorting archived mail further. I like Thunderbird's behavior of sorting by year, and the above mbox and save-hook settings accomplish this. This solution is thanks to Daniel Schömer on mutt-users and I have to admit that I don't fully understand it (if you do, I'd love an explanation). It appears to be smart enough to archive based in the year the message was sent, and that's exactly what I wanted.

Hope this series was helpful! If you have questions, please feel free to email me.