mu4e 1.14.4
I haven't written here in a while (those 13 years just flew by!) so it's about time to add something new, and I still beat The Winds Of Winter! While I haven't blogged much, I'm still using Emacs every day, and am still working on mu/mu4e, the Emacs e-mail client.
There have been quite a few changes in mu and mu4e in those years (think:
Theseus' Ship). Lately, there's a new version every few months, leading up all
the way to release 1.14.4 today.
I'll go through a number of useful features you may not yet know about. Some are new, some not so new. You can track all new features / changes in NEWS.org. Below changes are available in 1.14 or newer, unless mentioned otherwise.
Inbox zero: Adding tasks and refiling
Message refiling (moving message to some message-specific folder) is one of the
ancient, defining features of mu4e, inspired by the mutt mail-reader; I use it
all the time, together with the Org-mode support.
Following the "Inbox Zero" philosophy, I go through my inbox a few times per day:
- delete: For many/most messages: remove (e.g., most mailing-list messages).
- todo: If some further action is required, add a TODO item to my Org agenda (see below).
- refile: Move the message to the appropriate archive folder
After that, my inbox is nice & empty, "zero" again; David Allen would be proud! Let's look at (2) and (3) in a bit more detail.
Adding todo-items from mail
For messages that require some further action, I add a todo-item to the Org-mode agenda. For this, I use a number of capture templates.
You can start with something basic; add to org-capture-templates:
("m" "Handle mail" entry (file+headline "~/Org/todo.org" "Todos")
"* TODO %a from %:fromnameoraddress\n\t%u\n ")
The TODO-items link to the message they originate from, based on its message-id,
so you can jump (C-c C-o) to that message without a sweat, regardless of where
you moved it.
Refiling messages
As I walk through my inbox, I move messages I want to keep to some appropriate archive folder, and you can instruct mu4e to pick a good one for a given message.
You can make this arbitrarily complicated, but perhaps as a starting point on
your refiling journey, you could start by configuring mu4e-refile-folder
something like:
(setq mu4e-refile-folder
(lambda (msg)
(cond
((mu4e-message-sent-by-me msg) "/sent") ;; sent by me -> sent
;; all mu-related messages go to mu/
((or (mu4e-message-contact-field-matches msg :to "mu-discuss@googlegroups.com")
(mu4e-message-contact-field-matches msg :cc "mu-discuss@googlegroups.com")
(string-match "\\[mu\\]" (or (mu4e-message-field msg :subject) "")))
"/mu")
;; example messages go to the examples folder
((seq-some
(lambda (addr) (mu4e-message-contact-field-matches msg :from addr))
'("@example1\\.com$" "@example2\\.com$"))
"/examples")
;; if I'm an explict recipient, move to the "personal/" folder
((mu4e-message-personal-p msg) "/personal")
;; everything else goes to /bulk
(t
"/bulk"))))
mu4e 1.14.4 adds some handy aliases to make this less unwieldy, and you can
write:
(setq mu4e-refile-folder
(lambda (msg)
(cond
((mu4e-message-sent-by-me msg) "/sent") ;; sent by me -> sent
;; all mu-related messages go to mu
((or (mu4e-contact-matches-p msg :recip "mu-discuss@googlegroups.com")
(mu4e-subject-matches-p msg "\\[mu\\]"))
"/mu")
;; example messages go to the examples folder
((mu4e-contact-matches-p msg :from '("@example1\\.com$" "@example2\\.com$"))
"/examples")
;; if I'm an explict recipient, move to the "personal/" folder
((mu4e-message-personal-p msg) "/personal")
;; everything else goes to /bulk
(t
"/bulk"))))
As with anything Emacs / mu4e / org-mode: start simple and complicate things as
needed… I suppose it's fine to procrastinate a little bit on tweaking
productivity tools, but of course it's time that could have been spent on
watching TikTok videos.
MIME Type icons
A small cosmetic feature; if you have some "icon package" such as Nerd Icons or
All the Icons, you can tell mu4e to use them to decorate MIME-parts /
attachments, by setting mu4e-file-name-to-icon-function to
nerd-icons-icon-for-file or all-the-icons-icon-for-file. For nerd-icons I found
some extra tweaking may be needed, so if you get wrongly sized icons, you can
try something like:
(setq mu4e-file-name-to-icon-function
(lambda (name)
(nerd-icons-icon-for-file name :height 1.0)))
Completion
mu since 1.14.3 includes command-line auto-completion support for Bash, Zsh and
Fish (experimental, 1.14.4). Useful, since there are so many options/flags to
choose from.
Human Language detection
When built with CLD2 support, mu attempts to detect the human language a message
was written in, and you can search for it using the lang: field.
E.g. to find all messages in Finnish:
$ mu find lang:fi
Attachments in replies
Normally, a message reply does not include any attachments; however, for certain
kinds of attachments such as patches/diffs, it is useful to include an inline
version in the reply, so you can comment on it; and that is what mu4e does now;
configurable with mu4e-compose-reply-include-mime-types.
HTML messages
In the last few releases, mu4e has seen many improvements for dealing with HTML
messages.
- Switch-to-html (
mu4e-view-toggle-html,h) now works for all messages, which is useful for showing them in the browser, printing etc. (1.14.3) - In plain-text mode, we no longer show the [1] [2] link numbers until you need
them (after
mu4e-view-go-to-url(g) ormu4e-view-save-url(k)) (1.14.3) - Keyboard-handling for the link functionality is now also integrated with HTML-mode (using Emacs' completion interface) (1.14.4)
Back from the dead: xwidget for HTML messages
You can use Emacs' Xwidget support to show emails in a webkit widget (GTK3/pgtk). Unfortunately, xwidget support in Emacs had bitrotted (i.e., only worked with long-obsolete webkit versions) in the last few releases.
Fortunately, it wasn't too hard to fix this, and my efforts have landed in Emacs 31.1: xwidget is back!
With 1.14.4, I have integrated it a bit further in mu4e as well (still
experimental!); xwidget is still a bit un-Emacsy, but mu4e tries to terraform
it.
(setq mu4e-view-html-renderer 'xwidget) ;; default is the built-in 'shr
shr is fine for most messages, but some (looking at you, airlines!) can be hard
to decipher, and xwidget support makes those readable.
[ One sore point is that your (GTK3/pgtk) Emacs >= 31.1 probably does not have
xwidget support yet, unless you build it yourself (--with-xwidgets).
Understandably, distributions don't build Emacs with xwidgets since they
couldn't for a few years; let's hope support returns now. ]
Desktop notifications
For a while, mu4e has supported desktop notifications for new mail; this uses
Emacs' notification support, and is as simple as setting:
(setq mu4e-notification-support t) ;; set before starting mu4e
This gives you some pop-up when there's new mail; see the mu4e manual for details.
More recently, mu4e gained DBus service support, which allows for richer
interactions if you are on a platform with DBus. Assuming your Emacs has DBUS
support, you can enable it in your configuration with:
(mu4e-dbus-mode)
It is all still a bit in the IKEA-stage, but there's a script mu4e-dbus-client
in the mu sources, which allows you to add read/unread counts to Waybar, with
something like:
"custom/mu4e": {
"exec": "~/src/mu/contrib/mu4e-dbus-client --format waybar",
"return-type": "json",
"interval": 120,
"format": "{text}{icon}",
"format-icons": {
"empty": "ðŸ“",
"unread": "📬",
"new": "📧"
},
"tooltip" : true
}
Add custom/mu4e to your modules-right|left|center as desired, to get something
like:
The tooltip has read/unread counts for your bookmarked queries; nothing too spectacular, but it shows it's possible, so perhaps it can inspire you, dear reader, to add support for your favorite desktop bar.
Created: 2026-10-15 Thu 18:51