Reading Mail With Mu4e

Reading Mail With Mu4e

After using Gnus for well over fifteen years, I switched to mu4e (a part of mu) in the summer of 2012. My main reason for giving it a try was that its Org Mode links were not connected with the mail folder a message was stored in. That means that mail can be moved around without breaking any links. The Org Mode links made by Gnus do not support this. Additionally, the mu4e search functionality also looked a lot easier to understand. I have never really gotten used to Gnus' search.

Basic configuration for mu4e is, well, basic. You just need to tell Emacs that you need it and then tell mu4e where you keep your mail. I keep all messages, be they mail or news, below ~/msg/ and have a few special purpose mail folders below that. Conveniently, mu4e has dedicated variables for these so they can be customized easily. Note that their values are relative to mu4e-maildir.

(require 'mu4e)
(setq mu4e-maildir "~/msg")
(setq mu4e-drafts-folder "/DRAFTS"
      mu4e-refile-folder "/~ARCHIVE"
      mu4e-sent-folder   "/~SENT"
      mu4e-trash-folder  "/~TRASH")

I have named these folders in such a way that they sort nicely with LC_COLLATE=C. My unfinished messages are kept in a DRAFTS folder that sorts at the top. Anything I deem important enough to keep for posterity is refiled to my ~ARCHIVE. Messages that I've dashed off or scheduled for removal end up in ~SENT and ~TRASH folders that sort towards the end. In addition, I have an INBOX that holds unsorted and/or unprocessed messages and split stuff from mailing lists in list.* folders.

This keeps messages that need attention most urgently near the top and the low(er) priority stuff near the bottom of the folder list. By the way, that list is available via M-x speedbar, and if you were to add a ~SPAM folder the sort order still works out quite nice.

For the headers view I prefer a date format like that used by Org Mode for inactive timestamps. I also prefer to see whom I sent mail to if the message was sent by me rather than one of my own mail addresses.

(setq mu4e-headers-date-format "[%Y-%m-%d %a %R]"
      mu4e-headers-fields '((:date . 23)
                           (:flags . 6)
                           (:from-or-to . 25)
                           (:mailing-list . 10)

Note that the mailing-list field requires version or later and may not be all that useful if you split mailing lists into their own folders.

When looking at a single message, the date should look similar to the format used for Org Mode timestamps. However, this time I like to see seconds and time zone information as well. That's achieved with

(setq mu4e-date-format-long "%Y-%m-%d %a %T%z")

Finally, to activate the functionality that made me switch to mu4e in the first place

(require 'org-mu4e)