Space Panda

Reading Mail in the Terminal

This is the first article in a series on how to configure (neo)mutt. Other parts of the series are:


Now that the mail is synchronised and stored on the local machine, it’s time to read it. I’m using neomutt, but most of the configuration options that are shown here should be compatible with good old mutt, if you prefer that 1.


(neo)mutt uses several different screens (or as they call them: menus) for the different actions that can be performed. Here are the most important ones, and the ones that will likely receive the most customisation effort:

  • the index is the screen that lists the content of a mail box,

  • the pager shows the content of an email,

  • in the compose menu you can select the meta data for a new email (from, to, subject, attachments, encryption, etc.)

There are more menus that you can encounter, like the alias menu, the query menu, the attachment menu, the browser, the editor, and the pgp and smime menus.

Configuration File Location

All of the appearance and behaviour of neomutt can be configured through these files (in the order in which neomutt will look for them):

  1. ~/.config/neomutt/neomuttrc

  2. ~/.config/neomutt/muttrc

  3. ~/.config/mutt/neomuttrc

  4. ~/.config/mutt/muttrc

  5. ~/.neomutt/neomuttrc

  6. ~/.neomutt/muttrc

  7. ~/.mutt/neomuttrc

  8. ~/.mutt/muttrc

  9. ~/.neomuttrc

  10. ~/.muttrc

Only ~/.muttrc and ~/.mutt/muttrc are compatible with mutt, I think. So if you plan to use both mutt and neomutt, these are your options.

Configuration File Splitting

The configuration of (neo)mutt can become very complex (it’s currently about 41kB of configuration files in my neomutt folder). Luckily thanks to the source directive you can split the configuration file into multiple files. Of course, they should still reside at the same place; so I store my configuration files in ~/.config/neomutt/neomuttrc.

Including configuration files looks like this:

# ~/.config/neomutt/neomuttrc

# keyboard shortcuts
source "~/.config/neomutt/keys.rc"
# color scheme
source "~/.config/neomutt/colors.rc"
# gnupg defaults
source "~/.config/neomutt/gpg.rc"
# identity management
source "~/.config/neomutt/identities.rc"

Documentation

Most of the configuration options are very well documented at the neomutt guide and mutt’s documentation. Both programs also have extensive man pages for both the main executable (man mutt, man neomutt) and the configuration files (man muttrc, man neomuttrc).

I’ll link to neomutt’s help for most of the options that I use.

Here’s the next part of the series.

Footnotes

1

The emails are just stored in the Maildir format, so you could use just about any program that understands Maildir (e.g. Thunderbird). But they will mostly try and fetch mail on their own, which is probably not really what you want after having configured isync.


Tagged as mail, neomutt