Terminal-Based E-mail with Mutt
Basic Configuration
Set your name and e-mail address by creating ~/.muttrc and setting the from variable:
set from="Eric Radman <ericshane@eradman.com>"
Mutt can be set to use any text editor you like, simply edit .muttrc.
set editor="vim"
It's also possible to set specific options when VIM is started using this special syntax
set editor="vim +':set textwidth=78' +':set wrap'"
Mutt uses direct access to folders in your home folder by default, but it also has very good IMAP support
set imap_authenticators="login" set spoolfile=imap://localhost/ set folder=imap://localhost/ set imap_user="ericshane" set imap_pass="*****" set mail_check="360"
If you'd like to save drafts and sent messages, specify a local folder to save them in
set postponed="$HOME/.maildir/.Postponed" set record="$HOME/.maildir/.Sent"
Or specify an IMAP mailbox thusly
set record="=Sent Items" set postponed="=Drafts"
You may also have to set you're primary inbox
set spoolfile = "+INBOX"
Navigation Keys
q Quit d Mark to delete u Undelete m Start a new message @ Show reply-address v Show attachments s Save to another folder c Change folders C Copy to folder h Show/hide full headers $ Sync mailbox ; Apply to all marked messages
Customization
The query_command is a nifty feature that lets you assign a script or program to the Q key to search for an address entry.
set query_command="grep -B 2 -C 4 -i -e '%s' ~/addresses.vcf | grep -e "FN:" -e "EMAIL:" -e "--" | awk -F ":" '{ print $2 }'"
Header display
ignore * unignore X-Mailer date from subject to cc
MIME Types
Pressing v will show you the sections in an email
q:Exit s:Save |:Pipe p:Print ?:Help I 1 <no description> [text/html, base64, utf-8, 29K]
To customize the view edit .mailcap and enter a MIME type followed by the command to be used for viewing.
text/html; lynx -force_html %s
Mutt can also set this view in the preview window automatically
auto_view text/html
Also useful is print_command which can be used to teach mutt how or where to print.
set print_command="/usr/bin/lpr -Php5550"
Sorting
You can sort your mailbox with o key, and even enable threading with ot
Sort (d)ate/(f)rm/(r)ecv/(s)ubj/t(o)/(t)hread/(u)nsort/si(z)e/s(c)ore/s(p)am?:
To make this the default add the following to your .muttrc
set sort=threads set sort_aux=date
References
A Quick Guide to Mutt by Scott Robbins
My dotfiles by Suvlekhim Takatz
Notes on Mutt by Michael Elkins
Official Manual by Michael Elkins