Mutt-Homepage

The Mutt mailreader

On this page I describe, how I tried to make mutt most usable for my needs.

Resources:

Compressed Folders Patch:

I fear that I'm maintaining the compressed folders patch at the moment.

Little Brothers Database (lbdb):

This package consists of a set of small tools, which collect mail addresses from mails you received and then offer these addresses as well as data received using the finger command using mutt's external query feature. See my lbdb page for more information.

Metamutt (a Metamail replacement):

Maybe you want to use mutt as a MIME-viewer like metamail in other applications (e.g. with a newsreader), then try out my little metamutt script, which is a first try to create a replacement for metamail. With the option -D this script can be used to split mailinglist digests.

My config files:

  • ~/.mutt/muttrc (for 1.5.* only!) or ~/.mutt/muttrc-1.4 (for 1.4) keeps the real configuration stuff. I tried to insert all existing configuration options there and will try to keep this actual with all new versions, while there is no command in Mutt which writes back the configuration to a file. I will try to translate the comments step by step from German to English. This file should correspond to the latest mutt with some patches, all added configure options will be commented.
  • ~/.mutt/keybind (for 1.5.* only!) or ~/.mutt/keybind-1.4 (for 1.4) is sourced by muttrc and holds all my key bindings, some ideas are taken from pine, some from elm but I think it's more usable than the original configuration. Take a look at some of the macros defined in it:
    A
    Scan message for mail addresses which can be added to the aliases file by using mail2muttalias.py (Archiv).
    ESC a
    Starts an editor to change the aliases file and reloads the aliases file.
    Ctrl-p
    signs an outgoing mail or attachment with old style PGP but without changing the MIME-Type.
    ESC r
    reloads ~/.mutt/muttrc (be careful with this, some commands are reset before reloading!)
    ESC u
    tries to uudecode the mail using uudeview
    ESC f
    displays the X-Face header (if this exists in the actual viewed mail) using view-x-face, a little Perl script.
    ESC 1
    Switches to GNU privacy guard (GPG)
    ESC 2
    Switches to PGP 2.*
    ESC 5
    Switches to PGP 5.*
    ESC 6
    Switches to PGP 6.5.*
    ESC r
    Tries to receive all PGP keys which are used in a PGP message as sign keys or for which a message was encrypted using the script gpgfetchkeys and pkspxyc. This script only works in combination with GnuPG.
    ESC l
    Shows the message unchanged and without MIME decoding.
    Ctrl-b
    Searches for URLs in the decoded message by using urlview.
    I
    Toggle pager-index-view
    ESC t
    Show trace of mail routing using mailhops, written by Marius Gedminas
  • For optimal use of Mutt, you need a maximum complete ~/.mime.types file, which maps file extensions to MIME types.
  • Mutt should decode all MIME types correctly, so here's my ~/.mutt/mailcap, which works quite good with mutt (Netscape and lynx have some problems with it, so I use a special one for mutt). Here some external shell scripts and programs are used:
    • image2ascii is used to display convert an image to a (small) ASCII graphic, which can be displayed in Mutt's internal pager. This script needs the program convert from ImageMagick and pbmtoascii from netpbm.
    • zxdvi and zgv (zgv is a link to zxdvi) is a small shell script, which isplays a gzipped or compressed DVI or Postscript file using xdvi or gv (a great ghostview replacement).
    • dvi2tty-filter is a small script, which runs dvi2tty as a filter.
    • wv-ns is a small script, which tries to run wvWare and if this fails antiword on an MS Word document and displays this using Netscape or another browser.
    • antiword is a C program to convert MS Word documents to ASCII text or PostScript output.
    • octet-filter is a genius script written by Dave Pearson
    • vcard-filter is a small Perl script written by Dave Pearson, which brings application/x-vcard in a readable form.
    • tnef2txt written by Brandon Long is a converter which makes MS tnef MIME attachments human readable.
  • ~/.mutt/pgp2.rc: The Settings for PGP 2.*.
  • ~/.mutt/pgp5.rc: The Settings for PGP 5.*.
  • ~/.mutt/pgp6.rc: The Settings for PGP 6.*.
  • ~/.mutt/gpg.rc: The Settings for GnuPG >=0.9.6. This uses gpg-2comp by Gero Treuner to create PGP 2.* compatible messages.
  • And don't forget to create your own aliases file at ~/.mutt/aliases.

Procmail as a Mutt helper:

Mutt doesn't support old style PGP mails (yet), so it would be a good idea to use procmail for preprocessing the mails. I use the following rules to make PGP readable by mutt:
:0
* !^Content-Type: message/
* !^Content-Type: multipart/
* !^Content-Type: application/pgp
{
    :0 fBw
    * ^-----BEGIN PGP MESSAGE-----
    * ^-----END PGP MESSAGE-----
    | formail -i "Content-Type: application/pgp; format=text; x-action=encrypt"

    :0 fBw
    * ^-----BEGIN PGP SIGNED MESSAGE-----
    * ^-----BEGIN PGP SIGNATURE-----
    * ^-----END PGP SIGNATURE-----
    | formail -i "Content-Type: application/pgp; format=text; x-action=sign"
}

If you get mails written by the SUN mailtool or tools which are not MIME aware, you may want to get the attachments readable. For this I use the program emil which is able to convert SUN attachments, uuencoded parts or binhex to MIME. I use the following procmail configuration for this:

:0 fw
* ^Content-Type: x-sun
| emil -G mime8_user

:0
* Content-Type: text
{
        :0 fBw
        * ^begin [0-7][0-7][0-7]
        * ^end
        | formail -i Mime-Version | emil -G mime8_user
}
:0
* !Content-Type:
{
        :0 fBw
        * ^begin [0-7][0-7][0-7]
        * ^end
        | emil -G mime8_user
}

:0
* ^Content-Type: multipart/mixed
{
        :0 fBw
        * ^Content-Type: application/mac-binhex
        | emil -G mime8_user
}