This site is now 100% read-only, and retired.

A brief introduction to mutt-ng

Posted by Steve on Mon 14 May 2007 at 09:57

mutt is a well known and much loved mail client well suited to the efficient handling of a large volume of email. One of the things which makes it so powerful is its extreme flexibility and customisation options. The next-generation mutt package builds upon the core mutt with some additional features; most noticeably the introduction of a sidebar, which this article introduces.

To start with I'll explain how my current installation of mutt is configured. When the mail-client starts it reads and parses the per-user configuration file ~/.muttrc if present.

My current ~/.muttrc file consists of one line :

source ~/.mutt-`test -e ~/.mutt-$(hostname -s) && echo $(hostname -s) || echo global`

That looks pretty scary, but the result is pretty simple though:

  • If the file ~/.mutt-HOSTNAME exists it is read and parsed.
    • Where "HOSTNAME" is the short hostname of the current machine.
  • Otherwise ~/.mutt-global is read and parsed.

This system allows me to store the configuration specific to a number of different hosts within a single CVS tree without having to worry about replacing ~/.muttrc with the correct one on each machine.

The configuration snippet above can be broken down into two parts: The directive "source" which instructs the system to include, and process, another file, and the shell command which is sandwiched between ` (backtick) characters. If you're familiar with shell scripting this should be pretty recognisable to you - if not then don't worry about it!

The reason for introducing this file is to demonstrate how we can conditionally configure mutt to process different files, which is something we'll need later.

Rather than jumping ahead further we'll install the package. For the Etch release of Debian GNU/Linux you'll need to update your sources.list for APT, as the package isn't included in the release proper.

Add the following to your /etc/apt/sources.list file:

#  "Experimental" for mutt-ng
deb experimental main non-free contrib
deb-src experimental main non-free contrib

Once you've done that you may update your lists and install the package with your favourite package-manager. I use apt-get, you may use whatever you like:

vain:~# apt-get update && apt-get install mutt-ng

Once the mutt-ng package is installed you can test your current mutt setup with it. The package will load a different configuration file at startup, so you can either copy your ~/.muttrc file to ~/.muttngrc or create a symbolic link:

skx@vain:~$ ln -s ~/.muttrc ~/.muttngrc

Starting up muttng works just fine for me:

skx@vain:~$ muttng

With this setup I can immediately see my messages:

My normal setup

(There might have been errors if some configuration options I'd been using were removed in this package; however that wasn't the case for me.)

To get started using the new features of muttng I'll create a new configuration file ~/.mutt-sidebar with the following contents:

# Sidebar basics.
set sidebar_width=20
set sidebar_visible=no
set sidebar_delim='|'

# color of folders with new mail
color sidebar_new  red default

# ctrl-n, ctrl-p to navigate to the next/previous mailbox with unread mail.
# ctrl-o to open the selected folder.
bind index \CP sidebar-prev-new
bind index \CN sidebar-next-new

bind pager \CP sidebar-prev-new
bind pager \CN sidebar-next-new

bind pager \CO sidebar-open
bind index \CO sidebar-open

# Toggle sidebar visibility
macro index b 'toggle sidebar_visible'
macro pager b 'toggle sidebar_visible'

As I run mutt upon several systems which will only have the vanilla mutt package installed I must update my configuration file to load this new file conditionally. I can either cause the file to be loaded by adding "source ~/.mutt-sidebar" to ~/.mutt-vain, a host I have, or I can update ~/.muttrc with something like this:

#  Load the sidebar configuration file if this host has muttng
#  If not just show the version number of mutt on startup - the best
# side-effect free alternative I can think of!
`test -x /usr/bin/muttng && echo source .mutt-sidebar || echo "push "`

Either way we'll assume you've configured this appropriately.

Once you've started up your copy of mutt-ng after updating your configuration file you'll be able to press b to view the folder-browser. For me this looks something like this:

The mutt-ng sidebar active

To move the cursor to the next/previous mailbox containing new mail I simply press Ctrl+n, or Ctrl+p. The currently selected folder may be opened, or visited, by pressing Ctrl+o.

It didn't take me very long to get used to this new facility, since finding mailboxes with new mail visually is very simple and navigating amongst them is straight-forward.

Finally I'll sum up by saying that the future of the mutt-ng project looks uncertain. The mutt-ng homepage still exists, but there has been little activity recently. Reassuringly the development blog avows the project is not dead, but it seems like things are unlikely to develop quickly at the moment.

All in all though the additional features added to mutt by the mutt-ng fork seem reasonable and it is to be hoped they'll be accepted into the mainline project in the future.



Re: A brief introduction to mutt-ng
Posted by Anonymous (194.112.xx.xx) on Mon 14 May 2007 at 15:57
As the maintainer of the (now-dead) fork called "mutt-ng", I can assure you that the original project is absolutely dead. Mutt-ng now exists as a set of patches, but no efforts are being made that this will be released as separate packages. Due to the general lack of support through the community, I do not have the time nor the interest to continue my efforts, so mutt-ng as it exists now is primarily made for myself (and only rarely updated).

[ Parent ]

Re: A brief introduction to mutt-ng
Posted by Steve (80.68.xx.xx) on Mon 14 May 2007 at 16:52
[ View Weblogs ]

Thanks for letting us all know, even if the news isn't good.


[ Parent ]

Posted by Anonymous (85.216.xx.xx) on Tue 15 May 2007 at 09:50
So there had been changes in mutt within the last few weeks and now it is dead? A release of a devel version in april 2007?


[ Parent ]

Re: dead?
Posted by Anonymous (91.21.xx.xx) on Fri 18 May 2007 at 14:53
He was talking about the mutt-ng project being dead, not the mutt project itself.

[ Parent ]

Re: A brief introduction to mutt-ng
Posted by shufla (83.12.xx.xx) on Tue 15 May 2007 at 15:53


Ouch, bad news. I'm going to switch to mutt from Thunderbird/Evolution/KMal, with IMAP accounts and mutt-ng modifications are quite nice.

BTW - is there any possibility to download only message body without attachments from IMAP server? On #mutt answer was 'no', but I do not know if it is possible in IMAP.


[ Parent ]

Re: A brief introduction to mutt-ng
Posted by daemon (155.232.xx.xx) on Mon 14 May 2007 at 22:15
[ View Weblogs ]

It's a shame that this seems to have died, as having a list of mailboxes/folders visible and easily selectable is pretty nice. I was always hoping that elmo would pick up again, as while I never really used it more than giving it the once over, it seemed like it could have been a great app...

I'm in the process of shifting my $HOME user config files to version control (svn rather than cvs in my case), and I got around the .muttrc issue is a different way, but as you showed us your's, I thought I'd tell you about mine ;-)

Rather than have multiple host muttrc versions filling my repository, I have a single svn'd muttrc (actually ends up linked to ~/.mutt/muttrc) which contains a fairly generic collection of options that I like to use, the last line of which is 'souce ~/.mutt/muttrc.local' and any site specific options and overrides sit in that file. As the files get backed up anyway, I figured it was a nice way to do it, as it keeps my svn listing cleaner...


[ Parent ]

Re: A brief introduction to mutt-ng
Posted by Anonymous (213.162.xx.xx) on Tue 15 May 2007 at 16:15
On FreeBSD 6.2 and Debian Etch I haded to replace :

macro index b 'toggle sidebar_visible'
macro index b 'toggle sidebar_visible'
macro index b '<enter-command>toggle sidebar_visible<enter>'
macro pager b '<enter-command>toggle sidebar_visible<enter>'

[ Parent ]

Re: A brief introduction to mutt-ng
Posted by Anonymous (213.164.xx.xx) on Wed 16 May 2007 at 09:45
just for info "I had to replace"

[ Parent ]