Legacy web pages of Axel Beckert

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

Axel's Mutt Page

Just another little mutt page


Mutt 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. :-)

Mutt screen shot

My environment with mutt:

Some little tips for the configuration:

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. ;-)

  1. 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/:

    The ~/.muttrc itself then looks like that:

    source ~/.mutt/folders source ~/.mutt/muttrc source ~/.mutt/hooks source ~/.mutt/aliases source ~/.mutt/lists source ~/.mutt/headers source ~/.mutt/signatures source ~/.mutt/bindings source ~/.mutt/macros source ~/.mutt/format source ~/.mutt/colors source ~/.mutt/autoview source ~/.mutt/pgp
  2. 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:

    ### Axel's device-dependent mutt configuration if ( $?NO_X ) then ### From Windows-telnets or VT100 terminals ### setenv MUTT_SUSPEND "set" setenv MUTT_SMART_WRAP "unset" setenv MUTT_ASCII_CHARS "set" setenv MUTT_INDEX_FORMAT "%4C %Z %[%a %d %b] %-16.16F (%4l) %s%> %M" setenv MUTT_STATUS_FORMAT "-%r-%v: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?u? Unread:%u?%?d? Del:%d?%?F? Flag:%F?%?t? *:%t?%?b? Inc:%b? %?L?%L/?%?l?%l?]-%>-%?V?%V-?%P---" setenv MUTT_TO_CHARS " +TC-" setenv MUTT_STATUS_CHARS "-*%A" setenv MUTT_PAGER_FORMAT="-%S- %C/%m: %L %s" else ### Running X ### setenv MUTT_SUSPEND "unset" # ^Z isn't a very good idea in an xterm... setenv MUTT_SMART_WRAP "set" setenv MUTT_ASCII_CHARS "unset" setenv MUTT_INDEX_FORMAT "%4C %Z %[%a%d%b] %-16.16F [%-12.12L] (%4l) %s%> %M" setenv MUTT_STATUS_FORMAT "%r%v: <$USER@%h> %f [Msgs:%?M?%M/?%m%?n? New:%n?%?u? Unread:%u?%?d? Del:%d?%?F? Flag:%F?%?t? *:%t?%?p? Postponed:%p?%?b? Inc:%b? %?L?%L/?%?l?%l?]%>%?V?%V?%P" setenv MUTT_TO_CHARS " TC" setenv MUTT_STATUS_CHARS "A" setenv MUTT_PAGER_FORMAT="%S %C/%m: %L %s" endif

    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:

    $MUTT_ASCII_CHARS ascii_chars $MUTT_SMART_WRAP smart_wrap $MUTT_SUSPEND suspend set to_chars="$MUTT_TO_CHARS" set status_chars="$MUTT_STATUS_CHARS" set pager_format="$MUTT_PAGER_FORMAT" set index_format="$MUTT_INDEX_FORMAT" set status_format="$MUTT_STATUS_FORMAT"

    BTW: $VISUAL and $EDITOR are set to emacsclient.

Using mutt with GNU Emacs

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:

(defun axels-mail-mode-hook () (turn-on-auto-fill) ;;; Auto-Fill is necessary for mails (turn-on-font-lock) ;;; Font-Lock is always cool *g* (flush-lines "^\\(> \n\\)*> -- \n\\(\n?> .*\\)*") ;;; Kills quoted sigs. (not-modified) ;;; We haven't changed the buffer, haven't we? *g* (mail-text) ;;; Jumps to the beginning of the mail text (setq make-backup-files nil) ;;; No backups necessary. ) (or (assoc "mutt-" auto-mode-alist) (setq auto-mode-alist (cons '("mutt-" . mail-mode) auto-mode-alist))) (add-hook 'mail-mode-hook 'axels-mail-mode-hook) (server-start) ;;; For use with emacsclient

Some of this code I got from Vincent Lefevre, who has also a mutt page.

Using mutt with GNU Emacs under screen.

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:

screen 0 screen 1 /usr/local/bin/emacs -nw screen 2 /home/abe/bin/mutt-screen-start

where mutt-screen-start is a script, which sources my config.tcsh first and then runs mutt:

#!/usr/bin/tcsh -f source ~/.mutt/config.tcsh /usr/local/bin/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.

Mailing lists on server with multiple hostnames

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...)-:

Usage and short example

expandalias.pl lists.readable > lists.mutt-usable
Configuration commands:
expandhost from to
xalias alias address
Short example:
expandhost xyz.mydomain.com www.mydomain.com ftp.mydomain.com xalias friends My friends <friends@xyz.mydomain.com> will be expanded to alias friends My friends <friends@xyz.mydomain.com> alias friends-www My friends <friends@www.mydomain.com> alias friends-ftp My friends <friends@ftp.mydomain.com>

Copyright © 1999-2020 by Axel Beckert (abe@deuxchevaux.org)
Last modification: