Skip to main content

(My) perfect mail setup

Okay, I admit: "Perfect" is a strong word. In this case, however, I justify it by mentioning that the setup is perfect for ME.

#Begin with a bit of history of my used clients to describe what I was longing for

If you are just interested in the current setup without the background story, feel free to skip the anecdotes ;)

The past

When I first got a computer connected to the Internet (at probably far too young of age), connections were still billed by the minute and horribly slow. Using the (more than rudimentary, I might add) webmail interfaces was not really an option. Instead, I settled for a tool called "Outlook Express", which came pre-installed and would allow me to read and compose my mails offline and thus reduce my online time to two minutes per day (one minute for downloading and one minute for uploading mails).

A little later, I switched to Opera (rest in peace) as my main browser and subsequently as mail reader as well. It was at that time, when I got hooked up with a concept that was only much later introduced to the masses by Gmail: Labels (or, as Opera called it: Filter). In short, filters allow one message to appear in multiple places (e.g. in a folder for a certain colleague as well as in one for the corresponding project) and thus allows a more flexible way of sorting mails than traditional folders ("Do I put the mail here or there?"). All the mails were synced via IMAP to be present on multiple devices, which got relevant when I started studying and I was happy.

Fast forward a bit and I needed a calendar tool, which I found in Mozilla Sunbird; the "standalone lightning". Its decontinuation as well as my wish for encrypted mails (this one has changed a bit) made me leave my beloved Opera (sadly, I never returned) and switch to Thunderbird (with Enigmail and Lightning). I never grew too fond of it for a variety of reasons. I lost filters (never really understood the saved searches) and it felt terribly slow with (not so really) large mailboxes. Consequently, during the next years, I switched back and forth between the unloved Thunderbird and a plethora of different web mail interfaces; never being really satisfied.

I tried mutt a couple of times as well as lightweight GUI tools (slypheed), but couldn't ever make the move. One day, completely by accident, I stumbled upon notmuch, which would eventually become the centre of my setup. At that time, what I understood, was that I would be able to use tags in mutt (which is true, but only the very tip of the iceberg). It would take another year to find all the other components (and me almost writing software out of frustration over not finding a cli, CalDAV-enabled calendar tool).

The present

Meet the dramatis personae for my setup (in order of perceived importance):
  • notmuch
  • mutt-kz
  • mbsync
  • msmtp
  • owncloud
  • khal
  • vdirsyncer
  • pycarddav

That's an awful lot of tools just to get mails done and it takes even longer to configure them (mostly, because you've got so many options and need to decide what you WANT. Personally, I suck at that).


notmuch indexes your mail and allows you to search within in (from easy things as to more complex queries like "... and date:2013-01-01..2013-02-15"). And it allows you to do so amazingly fast, because it believes that you have "not much" mail ;) Fast as in "instantaneously".

It requires you to get a local copy of your messages into a maildir and also uses quite a bit of disk spaces to create the index (here: 2.4 GB of Maildirs and 600M of index), so this MIGHT be a problem, if you are on really small disks. I've also found, that it's notmuch (haha) fun on conventional hard drives and performs much better when used on solid state disks.

Bundled with it comes an emacs interface (which I've never used) and a vim interface (which I've used only very briefly) as well as the commandline interface. After downloading your mails with a tool of your choice (see below), running ''notmuch new'' will add them to the index and allow you to search for them.


This is a fork of the well-known mail client, enhanced by some notmuch-specific features, such as virtual folders (created by notmuch queries) and easy to access notmuch search functionality.

FIXME: Picture

In the beginning, the most important part for me were the tags as seen in the sidebar. When downloading emails, I would automatically execute some commands to add tags (e.g. everything from personA gets the tag "important"). However, I soon figured that it would take longer to select the tag from the sidebar than to just perform a search. Now I only ever see my inbox and the mailing lists inbox (which I created to reduce clutter). Came for the tags, stayed for the search.


As mentioned earlier, notmuch requires your mail to be locally available. The most common solution for this seems to be OfflineIMAP, a utility written in Python. While I'm using it for my backup machine, it's said(!) to have had some hiccups and be rather slow. I've never had any trouble with it, but decided to go with mbsync which is maintained by Ted T'so. Without much fuss, it downloads your mail from an IMAP server and stores it into a maildir.


Similarly to receiving mails, you need to be able to send them, which in my setup is done by msmtp -- a rather minimalistic smtp. It lacks a few features (most notably offline support/queueing) and was meant to be a temporary solution only. Maybe, sometime it will be replaced by something else.

All the really mail-related stuff is done by now and the rest is to allow both contacts and calendars to be synced among various devices


Any CalDAV/CardDAV server should be fine, I settled with an owncloud instance, that I had running already. Some people argue that, while it does almost everything, it does nothing really good and would recommend other solutions, but again: I haven't had any problem yet and thus see no reason to switch.


This is the tool to show your calendar entries on the commandline, either in form of an agenda, an interactive CLI or a static view. It does not (yet?) support a week view as you might know (and like?) from other tools, but is still quite usable. It also allows you to create new entries, which I have to admit to not having used ever.

The future (is now)

System Message: WARNING/2 (<string>, line 73)

Title underline too short.

The future (is now)


System Message: WARNING/2 (<string>, line 76)

Title underline too short.