The maze book for programmers!
mazesforprogrammers.com

Algorithms, circle mazes, hex grids, masking, weaving, braiding, 3D and 4D grids, spheres, and more!

DRM-Free Ebook

The Buckblog

assorted ramblings by Jamis Buck

Muttifying my Mail

5 December 2004 — 4-minute read

A recent thread on ruby-talk culminated (for me) in this post, in which I derided mutt for requiring too much configuration and being too hard to use. As I said in the post, “why should I bother learning/installing/configuring fetchmail and procmail AND mutt, when I could simply use Thunderbird and have it work with minimal configuration?”

Almost as soon as I posted that, I got to thinking. I use vim, don’t I? I’m no stranger to the CLI. So what have I got to be afraid of?

I had tried mutt, once. But I was trying to pop my mail directly from mutt, and the configuration just got in the way, and the interface drove me nuts, and I ran screaming. Was I ready, really ready, to try again?

The problem is, it is really an all-or-nothing when trying a new mail client. It’s not like you can easily go back-and-forth between clients, unless you leave your mail on the server, which is a pain because it’s got to be deleted from the server somehow... At any rate, I steeled myself for the pain and went for it.

I found the Gentoo Guide to Mutt E-mail to be an invaluable resource in getting all the pieces set up. It guided me through the configuration of fetchmail and procmail, and hinted at some good practices for tying all the pieces together. It took the better part of Saturday, but I’ve got all my old mail copied over from Thunderbird. In fact, I even got really brave and uninstalled Thunderbird, so I’m pretty much dedicated at this point. Mutt will have to be pretty painful, indeed, to motivate me to go through all that again.

So what do I think of this new setup? What has it bought me?

I’m still not 100% converted to the mutt philosophies, but I’m finding myself pleasantly surprised by some things.

  • Because I fetch my mail and store my mailbox locally, I can finally use the Gnome applets for checking my inbox. And because the applet only checks one folder per instance of the applet, I’ve got four instances of the applet going, each with a different animation, and each representing a different folder. This lets me see, at a glance, whether the new messages are specific to the Ruby mailing list, or the UUG, or just my default inbox. Very nice.
  • Because mutt is so thin, almost a gnat to Thunderbird’s behemoth, I don’t have to leave it up continuously. I’ve configured the applets to open mutt to the appropriate folder when clicked. Then, when I’m done reading my email, I simply close mutt. Very fast.
  • Because I’m using procmail, I can set up all kinds of customized filters to process my incoming mail, filtering them through (in my case) Spambayes to catch the ridiculous amount spam I get, and so forth. (Incidentally, I love spambayes. I’ve trained it on a corpus of about 100 spam messages and it is already nearly 100% accurate in determining what is spam, and what is ham. And it even has the “unsure” category, which is something that Thunderbird’s junk filter lacks, and which I absolutely cannot live without.)
  • I’m also using gurgitate-mail, a mail filter that uses Ruby scripts to filter messages. Mostly I’m just experimenting with it, but I like it a lot right now because it is so much more readable than procmail recipes. And because it’s a Ruby script, you can do anything with it.
  • I’ve also written a news aggregator in Ruby (I’m calling it “Feed My Mail” currently) that is tailored specifically to this kind of setup (procmail/mutt). It runs as a cron job, polling all of my configured feeds once per hour, on the hour. Then, it constructs an email message out of each new item and sends it through procmail. This means that I can use procmail and gurgitate recipes on my RSS feeds, too! (If you’re interested in “Feed My Mail”, I’m thinking about cleaning it up and posting it on my website. It’s pretty minimalistic right now, but certainly functional!)

But, it’s not all roses. I’m still trying to puzzle out a few things, and have had a few headaches:

  • Compiling mutt with slang made it impossible for me to select a white (as opposed to light gray) background. I prefer black-on-white color schemes, and I couldn’t do that with mutt until I recompiled mutt against ncurses. Took me a good hour and a half to figure that one out. The documentation still seems to indicate slang can do white backgrounds, but I couldn’t get it to work.
  • Charsets! Argh. Frustrating. I can’t seem to get extended characters (tildes, umlauts, japanese, korean, etc.) to work. I know it can work, but I don’t have the time to spend on it right now. As soon as I must have this feature, I’ll probably stop everything and puzzle it out, but for now it’s just a frustration.
  • Learning curve. I’m still dizzy from the mass of options and key bindings that mutt makes available. Like vim, though, you take it a little at a time. I just wish I wasn’t such a power user—I’m wanting to do all kinds of advanced stuff, but am being forced to take baby steps to work my way up to that.

Anyway, it looks like I’ve got mail. Judging from which applets are animated, it looks like ruby-talk and my news aggregator have borne fruit. Time to read!