Since I'm no more active at the Fachschaftsrat Informatik of the University of Saarland anymore, I have transferred all my university time legacy web pages from http://fsinfo.cs.uni-sb.de/~abe/ to this interim host at http://fsinfo.noone.org/~abe/ with only minimal modifications, mainly e-mail addresses.
Most pages on this interim host won't be updated anymore until they are moved (and redirected) step by step to their future home somewhere under http://noone.org/.
Please also note that my former e-mail address
abe@fsinfo.cs.uni-sb.de is
no more valid. Use abe@deuxchevaux.org
instead.
— Axel Beckert, Zürich, 23rd of September 2007
Just another little mutt page
Mutt (http://www.mutt.org/) is a highly configurable and therefore very flexible mail user agent (MUA) for UNIXes and other OSes supporting MIME, IMAP, POP, color, threading and multiple inboxes - and all that without the need of having a GUI. It's simply the best of both worlds: Elm and Pine. :-)
Here you'll find some of my own tips & tricks regarding mutt. Maybe this page will become bigger some day. (Just set it up because Sven Guckes gave me a broad hint to write a little bit of my own about mutt. ;-)
Splitting the .muttrc
: Splitting the
.muttrc
in several files - preferable located in
~/.mutt/
- which are sourced by the source
command in ~/.muttrc/
. Some advantages of such splitting:
The ~/.muttrc
is forseeable, some feature (like colors or
using mutliple signatures) can bei disabled bei just adding one
#
in the .muttrc
, etc. E.g. I have the
following files in ~/.mutt/
:
aliases
: The file for aliases.
bindings
: All key bindings are located here.
folders
: Mailboxes, mail directory,
folder-hooks, compressed folder hooks: All those
things can be found here.
hooks
: Here are all fcc- and save-hooks
listed.
signatures
: Here are the send-hooks for
different signature file defined.
colors
: Color definitions.
format
: Format strings for index and status
layout, etc.
macros
: Macro definitions
pgp
: All configuration variables concerning
PGP.
autoview
: Handling MIME attachments, etc.
headers
: Weedout list and my own extra
headers.
lists
: Everything (aliases, fcc- and
save-hooks) concerning mailing-lists.
muttrc
: Configuration variables for mutt's
general behaviour.
The ~/.muttrc
itself then looks like that:
Device-dependent configuration: I use mutt as well in big
sized xterms as on VT100 text terminals. Therefore I need different
configurations, e.g. no suspending in xterms, short status bars on
80x25 screens, etc. I manage this with a little file source in my
.tcshrc
: I called config.tcsh
and it's
located in ~/.mutt/
. It's content looks like the
following:
The environment variable $NO_X
is set in the file
.login
in dependence of $TERM
,
$DISPLAY
and $REMOTEHOST
, so that it's set,
if I login from some machine with text terminal or simple telnet.
As you see above, especially those format strings, some indication characters and some other features are disabled or enabled according to the used terminal.
The approriate part of my .muttrc (and its sourced files) look like that:
BTW: $VISUAL
and $EDITOR
are set to
emacsclient
.
Because GNU Emacs is the best ;-) editor, I use mutt with GNU Emacs
and emacsclient
. I use the mail-mode
(which
is derivate of the text-mode
) with auto-fill
for automagical line breaks and font-lock
for having a
colorful day. The appropriate part of my
.emacs
look like that:
Some of this code I got from Vincent Lefevre, who has also a mutt page.
When logging in from a non-X-machine I automatically start
screen
with a shell (tcsh
),
mutt
and emacs
. Therefore my
~/.screenrc
looks like this:
where mutt-screen-start is a script, which sources my
config.tcsh
first and then
runs mutt
:
This is necessary, because screen doesn't source the shell's init file
(here ~/.tcshrc
) automatically when executing a program
in a screen window.
I had the following problem: Some of our local mailing lists are reachable on various machines of which some have up to four DNS entries. And be sure: All four are used in mails. But if I want to have the list name instead of the list address displayed in my index, I have to create an alias for each address a list has, because mutt doesn't (yet) support some kind of regexp-using display aliases.
So I wrote a little PERL script called
expandalias.pl
(you can also download a gzipped
version) which gets lists of equivalent hostnames and expands
automatically all aliases which are defined with xalias
instead of alias
. Distributed under
GPL 2.0.
For example, the file
lists.readable
(size: 684 bytes) becomes
lists.mutt-usable
(size: 1,375 bytes). You can also
compare them on one page. (I
know that the files are much too wide to be displayed on one screen,
but I don't see any possibility to change that...)-:
expandalias.pl
lists.readable
> lists.mutt-usable
expandhost from to
xalias alias address