Alexey's blog

Switching to Mutt

3 minute read Published: 2015-05-18

I've been using the Mailbox client for some time now and, while it's great and enjoyable to use, it's a big gui app that I had to constantly switch over to in order to check my emails. That was rather annoying so I started looking for an alternative that could be used inside the terminal and stumbled upon Mutt. A couple of days ago @tutec mentioned that he was going to switch to it as well. He said that if I were to switch to it before him and write a blog post, he'd read it. So here goes!

Now, I will not go into great detail on setting it up, mostly because it's been done many times before. Instead, I'll link the resources that helped me figure things out and also add a few tips myself. Hopefully this will be at least somewhat helpful.

I want to thank @georgebrock for sharing his dotfiles, since I've shamelessly took most of them as a basis for my Mutt setup. It was rather overwhelming at first, but after spending a while reading through the documentation, I've started figuring things out.

Here's my brief overview of the Mutt setup:

There are a few other things like muttqt or notmuch that can improve your workflow even further, but I'll leave that out for now, mostly because I am still going through fine-tuning the setup I've configured so far.

These are the links I found useful, that helped me figure things out, most of them repeat each other, but I encourage you to read them, try using the settings mentioned, then go to @georgebrock's dotfiles and try to understand what's going on. I realize that it can be tedious and time-consuming, but trust me, you'll get to that very enjoyable "Ah-ha!" moment soon enough and will learn more by studying the building block and comparing them to a full setup:

The last two were especially great. They are both fairly long, but I guarantee you there is a lot of useful info in there that might help you if you get stuck.

Speaking of which, now is the time to share my struggles.

"XYZ is not a mailbox"

Mutt has a couple of options for storing your emails, like mbox and Maildir. There are many differences between the two, including the performance aspect. You can read more about those here. In simpler terms, mbox is a single file where all your messages get concatenated together, whereas Maildir is a system of directories that store your emails. And that's where I got stuck: if you read a guide saying how you should have a ~/.mbox, that means that you should create a .mbox file there, not a folder. And the opposite is true for the Maildir. It sounds pretty obvious, but it caught me off guard.

I should also clarify that there are other options beyond the two mentioned, but these ones seem to be the most popular ones.

Not seeing any messages

I suggest looking into configuring offlineimap. Chances are, you have configured your account settings properly, but haven't actually downloaded the emails from a server.

There are other things you can use for that too, like procmail, fetchmail or getmail.

Either that or you need to switch into your mail directory from within Mutt. To do that press "c" on your keyboard and navigate to the correct folder.

Applying the sidebar patch

There is a feature you can add to your Mutt installation by applying a patch. It's a sidebar that looks something like this:

sidebar

It can make navigating the directory structure a bit easier. To install it on OS X you should follow the steps described in this SO answer.

Conclusion

There is still a lot to cover about Mutt, but nothing will help you as much as sitting down and going through the official docs and trying things out on your own so I highly recommend doing that.