'Archaic', text based email clients rock
Tags: emacs, email, productivity, elisp
Published: 2019-07-14 02:16:39

---
title: "'Archaic', text based email clients rock"
tags: emacs, email, productivity, elisp
published: true
---

#  Contents

1.  [TLDR - for the busy folks](#orgfeeaf85)
    1.  [Goals:](#orgd90dade)
    2.  [Summary:](#org66853f4)
2.  [Multiple email accounts. Lack of a unified interface.](#org3138e2b)
3.  [Creating sync channels via `mbsync`](#org4deb006)
4.  [Text based email client! Speed + simplicity](#org843e491)
5.  [Why mu4e rocks [for me] - the perks](#orgd281942)
6.  [Quirksx](#orgd7f7513)
7.  [Multiple levels of filters are still necessary.](#org0f0f9f0)
8.  [Takeaways](#orge43c2bc)
9.  [Links and References](#org43c6709)

The post below inspired me to complete this languishing draft of my current email setup, and the benefits I've gained from using a text based email client in Emacs.

{% link myterminal/how-i-unified-my-email-accounts-in-2019-1pji %} 

Hope you find it entertaining. In any case, the links and reference section will certainly prove useful. This article is also posted on my personal website.


<a id="orgfeeaf85"></a>

# TLDR - for the busy folks


<a id="orgd90dade"></a>

## Goals:

-   Unification of email accounts while preserving separate individual components.
-   Local backup of email.
-   Potential to extend system to a personal server
-   Email access from Emacs !
-   Hopefully improve overall productivity with reduced context switching.


<a id="org66853f4"></a>

## Summary:

1.  Started with 2 Gmail accounts and 1 MSN account.
2.  Switched to a paid account with Fastmail.
3.  Used Fastmail's tools to transfer email from both Gmail and MSN accounts.
4.  Setup forwarding for all new emails to Fastmail.
5.  Decided between retaining copies of emails in Gmail/MSN or deleting them once forwarded.
6.  Used customised settings in mu4e to manage Email from within Emacs.
7.  Occasionally rely on web browser / iOS app. Fastmail's interface is clean and very fast.
8.  Goals Achieved !! Live with the quirks and enjoy the perks.

Look at the [Links and References](#org43c6709) section for almost all the resources I relied on.

A portion of my mu4e configuration is available [on my website](https://shrysr.github.io/docs/sr-config/#mu4e). The personal filters and configuration are placed in an encrypted file.

My mbsync configuration is also shared for reference.


<a id="org3138e2b"></a>

# Multiple email accounts. Lack of a unified interface.

Some years back, I found that I had 2 Gmail accounts, and an MSN account. I discarded age old Yahoo and rediffmail accounts which were luckily not used much (and God knows how many more I made as a kid).

Gmail's interface felt just about tolerable, but inconvenient. The idea of viewing ads tailored to the content of emails had become disconcerting. Their Inbox app was interesting, but did not work smooth enough. MSN's web interace and apps always felt cumbersome, though updates over the years, this has improved significantly.

Useful emails could be email digests that contain a wealth of links, discussions, articles and information. Or perhaps email digests of product and technology news that are useful to retain as an archive of reference.

It would be nice to be able to process these links in a systematic manner, and have them available with a fast search system that is also integrated with a task management system.

> My solution was to switch to forwarding all my emails to a single Fastmail account. It's been an excellent experience over 2+ years.<sup><a id="fnr.1" class="footref" href="#fn.1">1</a></sup>,<sup><a id="fnr.2" class="footref" href="#fn.2">2</a></sup>


<a id="org4deb006"></a>

# Creating sync channels via `mbsync`

My mbsync configuration is posted as a [public gist](https://gist.github.com/shrysr/21676fc69d50337d94c5648b9d31f70a). It is reasonably self explanatory, and shows how separate channels were made grouping together folders, by specifying a pattern. This took some time, but was finally very satisfying to know as a fine grained control technique.

> I started out using offlineimap. I found mbsync to be significantly faster.

{% gist https://gist.github.com/shrysr/21676fc69d50337d94c5648b9d31f70a %}


<a id="org843e491"></a>

# Text based email client! Speed + simplicity

Imagine being engrossed with your code or engineering notebook and the need for shooting off an urgent brief email arises. What if this could be done with a few key-presses on an email client, right from the terminal or the code editor that you are already engrossed in?

How about adding an email as a task in your organiser with a deadline / planned date?

What if I had the option to setup separate channels of mail transfer, such that I can sync the inbox or a custom group of folders alone when I am pressed for bandwidth or space?

Practical solutions will need to cater to a lot more situations.

> The good news is: usually anything you need is possible (or already implemented) using Emacs.

I use [mu4e](https://www.djcbsoftware.nl/code/mu/mu4e.html), which uses the indexer mu as it's back-end. There are other popular options like [notmuch](https://notmuchmail.org/) and [mutt](http://www.mutt.org/). I have briefly experimented with mutt, which has a fast email search capability, but has to be coupled with another front-end to be used within Emacs or elsewhere. The philosophy and system behind notmuch (leveraging the Gmail tag based approach) differ from mu4e.

Over a few years of using this system, I have found that text and terminal based email clients offer a speed and integrity that is extremely pleasing.


<a id="orgd281942"></a>

# Why mu4e rocks [for me] - the perks

The ability to create custom search filters (called bookmarks) that can be accessed with easy shortcuts. This is an example of bookmark configuration:

    (setq mu4e-bookmarks
          `( ,(make-mu4e-bookmark
    	   :name  "Unread messages"
    	   :query "flag:unread AND NOT flag:trashed"
    	   :key ?u)
    	 ,(make-mu4e-bookmark
    	   :name "Today's messages"
    	   :query "date:today..now"
    	   :key ?t)
    	 ,(make-mu4e-bookmark
    	   :name "Last 7 days"
    	   :query "date:7d..now"
    	   :key ?w)
    	 ,(make-mu4e-bookmark
    	   :name "Messages with images"
    	   :query "mime:image/*"
    	   :key ?p)
    	 ,(make-mu4e-bookmark
    	   :name "Finance News"
    	   :query (concat "from:etnotifications@indiatimes.com OR "
    			  "from:newsletters@valueresearchonline.net"
    			  "from:value research")
    	   :key ?f)
    	 ,(make-mu4e-bookmark
    	   :name "Science and Technology"
    	   :query (concat "from:googlealerts-noreply@google.com OR "
    			  "from:reply@email.engineering360.com OR "
    			  "from:memagazine@asme.org"
    			  "from:action@ifttt.com"
    			  "from:digitaleditions@techbriefs.info")
    	   :key ?S)
             ))

This is how it looks:

![](https://thepracticaldev.s3.amazonaws.com/i/3pi26b83upmg32yuh4dy.png)

Complete keyboard based control, and using it with Emacs means the ability to compose email from anywhere and build all kinds of workflows. Examples:

- Hit Control+x and m (`C-x m`) in Emacs parlance, and I have a compose window open.

- There are built-in workflows and functions in starter-kits like [Scimax](https://github.com/jkitchin/scimax), which enable you to email an org-heading or buffer directly into an email, with the formatting usually preserved, and as intended.

I often use yasnippet to insert links to standard attachments like my resume. This essentially means being able to attach files with a 1-2 key strokes.

While Mu4e may be a programmatic solution with no pleasing GUI - it allows one to search a large number of emails with glorious ease. This is particularly more effective on a SSD drive, rather than the conventional Hard disk.

One has to experience the above to *know* the dramatic impact it makes in getting closer in speed to your thoughts, using a customisable system.  Emails can be easily captured or added as tasks into [Org mode](https://orgmode.org/) documents as a part of task and project management.

Using the mu4e and mbsync, I've devised a 'sane inbox' which is bereft of the noise, like annoying digests, social media updates and so on.  The idea was to dedicate focused blocks to rapidly process email, all within Emacs.

I have tried using Todoist extensively in the past, along with their integration with Gmail. This approach is a reasonable solution, if one is open to using different applications.


<a id="orgd7f7513"></a>

# Quirks

`mu4e` is a text based email interface. It can be set such that the rendered `HTML` is displayed in the mu4e-view buffer for each email, which enables graphics and pictures (if any). However, the render is not perfect at all times.  The HTML parsing engine can be specified. Thus, heavy `HTML` emails are unlikely to render correctly, to the extent of being a nuisance.

> Such emails can be viewed in the browser of your choice with merely 2 key presses, 'a' and then 'v', with cursor in the body of the email. This could be Firefox, or [w3m](http://w3m.sourceforge.net/) or any other browser of your choice.<sup><a id="fnr.3" class="footref" href="#fn.3">3</a></sup>

Email syncing frequency is set in mu4e. This update process takes a few seconds, and it is not as seamless as a web app. Notifications for new email can be configured on the mode line or through pop-ups in Emacs. However, the experience with working synced emails is good.


<a id="org0f0f9f0"></a>

# Multiple levels of filters are still necessary.

Situations where I do not have access to Emacs will need me to use the iOS app or the web interface. Therefore the inbox in the web interface here cannot be 'insane', and a higher level of filters need to be implemented in Fastmail itself.

For example all Linked in group and job updates have their own folders. These folders are all sub-folders of the Archive. They never reach the inbox at all. These emails often remain unread, or if necessary, I can focus on bunches of them at a time.

> By grouping all such incoming mails into sub-folders within the Archive folder, I can use a single channel for all the  *relatively* unimportant mail.


<a id="orge43c2bc"></a>

# Takeaways

-   Using an 'archaic' text based email client (mu4e) has significantly boosted the speed with which I can handle my emails and focus on tasks. The simple interface and speed enables better focus.

-   While there are many articles and plenty of guidance on this topic, it takes time and patience to get this working the way you need it to. However, once it is setup, it does become rather comfortable to use.

-   Context switching is expensive on the brain and dents productivity.

-   Integrating email with time and project management is important. mu4e integrates well with Org mode. Beyond tasks, it is also a good reference, and I can easily attach notes, summaries etc to these emails.


<a id="org43c6709"></a>

# Links and References

These are the links and references I've used in setting up and troubleshooting my email setup.

> These could be organized better, and some links may be repeated. All put together, these should give you all you need to get hooked up!

> Some of the links have additional comments, and many are tagged with dates, as a reference to when I collected the link. Sometimes, this is fun to reflect on!

-   [A Complete Guide to Email in Emacs using Mu and Mu4e](http://cachestocaches.com/2017/3/complete-guide-email-emacs-using-mu-and-/), <span class="timestamp-wrapper"><span class="timestamp">&lt;2017-03-08 Wed 10:04&gt;</span></span>
-   [Reading IMAP Mail in Emacs on OSX | Adolfo Villafiorita](http://www.ict4g.net/adolfo/notes/2014/12/27/EmacsIMAP.html), <span class="timestamp-wrapper"><span class="timestamp">&lt;2016-11-27 Sun 08:17&gt;</span></span>
-   [ ] Excellent link talking about mu4e and notifications [Handling Email with Emacs – malb::blog](https://martinralbrecht.wordpress.com/2016/05/30/handling-email-with-emacs/), <span class="timestamp-wrapper"><span class="timestamp">&lt;2016-08-01 Mon 18:37&gt;</span></span>
-   [Which email client (mu4e, Mutt, notmuch, Gnus) do you use inside Emacs, and why? : emacs](https://www.reddit.com/r/emacs/comments/3s5fas/which_email_client_mu4e_mutt_notmuch_gnus_do_you/)  <span class="timestamp-wrapper"><span class="timestamp">&lt;2016-05-31 Tue 07:32&gt;</span></span>
-   [emacs-fu: introducing mu4e, an e-mail client for emacs](http://emacs-fu.blogspot.in/2012/08/introducing-mu4e-for-email.html) - Emacs and mu4e stuff  <span class="timestamp-wrapper"><span class="timestamp">&lt;2016-04-20 Wed 13:02&gt;</span></span>
-   [Emacs as email client with offlineimap and mu4e on OS X */ KG /* Hacks. Thoughts. Writings.](http://www.kirang.in/2014/11/13/emacs-as-email-client-with-offlineimap-and-mu4e-on-osx/) - nice blog related to Emacs and linux  <span class="timestamp-wrapper"><span class="timestamp">&lt;2016-04-21 Thu 22:44&gt;</span></span>
-   [EOS: Mail (Email) Module](http://writequit.org/eos/eos-mail.html) - explaining multiple email setup in mu4e  <span class="timestamp-wrapper"><span class="timestamp">&lt;2016-04-27 Wed 07:56&gt;</span></span>
-   [The Ultimate Emailing Agent with Mu4e and Emacs – Emacs, Arduino, Raspberry Pi, Linux and Programming etc](http://tech.memoryimprintstudio.com/the-ultimate-emailing-agent-with-mu4e-and-emacs/), <span class="timestamp-wrapper"><span class="timestamp">&lt;2016-08-17 Wed 13:19&gt;</span></span>
-   [Varun B Patil | EOM a.k.a End of Mail a.k.a Emacs + offlineimap + mu4e](http://varunbpatil.github.io/2013/08/19/eom/#.VxXTtM7hXCs) - multiple accounts  <span class="timestamp-wrapper"><span class="timestamp">&lt;2016-04-19 Tue 12:19&gt;</span></span>
-   [Master your inbox with mu4e and org-mode | Pragmatic Emacs](http://pragmaticemacs.com/emacs/master-your-inbox-with-mu4e-and-org-mode/)  <span class="timestamp-wrapper"><span class="timestamp">&lt;2016-03-26 Sat 14:56&gt;</span></span>
-   notmuch - email setup  [My personal mail setup — Articles — WWWTech](https://wwwtech.de/articles/2016/jul/my-personal-mail-setup) <span class="timestamp-wrapper"><span class="timestamp">&lt;2017-06-13 Tue 16:09&gt;</span></span>
-   [Search-oriented tools for Unix-style mail | Mark J. Nelson](http://www.kmjn.org/notes/unix_style_mail_tools.html), <span class="timestamp-wrapper"><span class="timestamp">&lt;2017-05-10 Wed 16:29&gt;</span></span>
    -   interesting comparison of mu and notmuch, going beyond superficial
        differences, but not too much depth either.
-   [Mutt with multiple accounts, mbsync, notmuch, GPG and sub-minute updates | French to English translator](https://lukespear.co.uk/mutt-multiple-accounts-mbsync-notmuch-gpg-and-sub-minute-updates), <span class="timestamp-wrapper"><span class="timestamp">&lt;2017-04-28 Fri 07:19&gt;</span></span>
    -   interesting link, author profile and content available on-line.
-   [Assorted Nerdery - Notmuch of a mail setup Part 2 - notmuch and Emacs](https://bostonenginerd.com/posts/notmuch-of-a-mail-setup-part-2-notmuch-and-emacs/), <span class="timestamp-wrapper"><span class="timestamp">&lt;2017-04-27 Thu 18:41&gt;</span></span>
-   Mutt,  mu4e and notmuch links
    -   [bash - Send Html page As Email using "mutt" - Stack Overflow](https://stackoverflow.com/questions/6805783/send-html-page-as-email-using-mutt)
    -   [Reading html email with mutt](https://fiasko-nw.net/~thomas/projects/htmail-view.html.en)
    -   [Prefer plain text format over HTML in mutt](https://xaizek.github.io/2014-07-22/prefer-plain-text-format-over-html-in-mutt/)
    -   [Using emacs and notmuch as a mail client - Foivos . Zakkak . net](http://foivos.zakkak.net/tutorials/using_emacs_and_notmuch_mail_client.html)
    -   [Help with mu4e multiple accounts : emacs](https://www.reddit.com/r/emacs/comments/4jqyzu/help_with_mu4e_multiple_accounts/)
    -   [Using Mutt, OfflineIMAP and Notmuch to wrangle your inbox. : linux](https://www.reddit.com/r/linux/comments/3kj6v4/using_mutt_offlineimap_and_notmuch_to_wrangle/)  <span class="timestamp-wrapper"><span class="timestamp">&lt;2016-06-16 Thu 15:23&gt;</span></span>
    -   [A year with Notmuch mail {LWN.net}](https://lwn.net/Articles/705856/) <span class="timestamp-wrapper"><span class="timestamp">&lt;2018-04-17 Tue 01:21&gt;</span></span>
-   mu4e specific Links  <span class="timestamp-wrapper"><span class="timestamp">&lt;2016-04-19 Tue 21:48&gt;</span></span>
    -   [Mu4e 0.9.16 user manual: Gmail configuration](http://www.djcbsoftware.nl/code/mu/mu4e/Gmail-configuration.html#Gmail-configuration)
    -   [mu4e tutorials - Google Search](https://www.google.co.in/search?q=mu4e+tutorials&ie=utf-8&oe=utf-8&gws_rd=cr&ei=4IwVV5jkC8fd0ATZ3q2gDA)
    -   [Tutorial: email in Emacs with mu4e and IMAP+SSL : emacs](https://www.reddit.com/r/emacs/comments/3junsg/tutorial_email_in_emacs_with_mu4e_and_imapssl/)
    -   [mu4e tutorials | Pragmatic Emacs](http://pragmaticemacs.com/mu4e-tutorials/)
    -   [Drowning in Email; mu4e to the Rescue.](http://www.macs.hw.ac.uk/~rs46/posts/2014-01-13-mu4e-email-client.html)
    -   [Emacs & the obsessive email mongerer | Moved by Freedom – Powered by Standards](http://standardsandfreedom.net/index.php/2014/08/28/mu4e/)
    -   [Mu4e + nullmailer - Google Groups](https://groups.google.com/forum/#!topic/mu-discuss/NzQmkK4qo7I)
    -   [Leaving Gmail Behind « null program](http://nullprogram.com/blog/2013/09/03/)
    -   [view html mails in mu4e - Google Search](https://www.google.co.in/search?q=view+html+mails+in+mu4e&ie=utf-8&oe=utf-8&gws_rd=cr&ei=e74VV__iOMPM0ASlsq2ACg)
    -   [Mu4e 0.9.16 user manual: Reading messages](http://www.djcbsoftware.nl/code/mu/mu4e/Reading-messages.html)
    -   [In mu4e, is this how your HTML-heavy emails render? : emacs](https://www.reddit.com/r/emacs/comments/1xad11/in_mu4e_is_this_how_your_htmlheavy_emails_render/)
    -   [Varun B Patil | EOM a.k.a End of Mail a.k.a Emacs + offlineimap + mu4e](http://varunbpatil.github.io/2013/08/19/eom/#.VxXTtM7hXCs)
    -   [Mu4e 0.9.16 user manual: Marking messages](http://www.djcbsoftware.nl/code/mu/mu4e/Marking-messages.html#Marking-messages)
    -   [change the date column format in mu4e - Google Search](https://www.google.co.in/search?q=change+the+date+column+view+in+mu4e&ie=utf-8&oe=utf-8&gws_rd=cr&ei=TDgWV8zEBIOLuwTXk5uYAw#q=change+the+date+column+format+in+mu4e)
    -   [Mu4e 0.9.16 user manual: HV Overview](http://www.djcbsoftware.nl/code/mu/mu4e/HV-Overview.html)
    -   [increase column size in mu4e - Google Search](https://www.google.co.in/search?q=increase+column+size+in+mu4e&ie=utf-8&oe=utf-8&gws_rd=cr&ei=ZjsWV7TDLJW3uQT6qZEY)
    -   [Mu4e 0.9.16 user manual: HV Custom headers](http://www.djcbsoftware.nl/code/mu/mu4e/HV-Custom-headers.html)
    -   [mu4e-manual-0.9.9.pdf](https://ftp.fau.de/gentoo/distfiles/mu4e-manual-0.9.9.pdf)
    -   [do mu4e folders sync with gmail folders - Google Search](https://www.google.co.in/search?q=do+mu4e+folders+sync+with+gmail+?&ie=utf-8&oe=utf-8&gws_rd=cr&ei=7DsWV7-NHIyXuASgtJ44#q=do+mu4e+folders+sync+with+gmail+folders)
    -   [mu4e Send mail with custom SMTP and archive in Gmail "Sent" folder : emacs](https://www.reddit.com/r/emacs/comments/3r8dr3/mu4e_send_mail_with_custom_smtp_and_archive_in/)
    -   [Using mu4e · Brool ](http://www.brool.com/post/using-mu4e/)
    -   [are maildir folders synced back to gmail ? - Google Search](https://www.google.co.in/search?q=are+maildir+folders+synced+back+to+gmail+?&ie=utf-8&oe=utf-8&gws_rd=cr&ei=RlwWV5TKKI62uASltLz4Ag)
    -   [Some real use cases](http://www.offlineimap.org/doc/use_cases.html)
    -   [About](http://deferred.io/about/)
    -   [Backing up Gmail messages with offlineimap](https://bluishcoder.co.nz/2013/04/30/backing_up_gmail_messages_with_offlineimap.html)
    -   [notmuch email versus mu4e - Google Search](https://www.google.co.in/search?q=notmuch+email+versus+mu4e&ie=utf-8&oe=utf-8&gws_rd=cr&ei=zmcWV8eVEIqdugTzkIpo)
    -   [Which email client (mu4e, Mutt, notmuch, Gnus) do you use inside Emacs, and why? : emacs](https://www.reddit.com/r/emacs/comments/3s5fas/which_email_client_mu4e_mutt_notmuch_gnus_do_you/)
    -   [A Followup on Leaving Gmail | Irreal](http://irreal.org/blog/?p=2897)
    -   [Sup?](http://cscorley.github.io/2014/01/19/sup/)
    -   [Mutt + Gmail + Offlineimap](https://pbrisbin.com/posts/mutt_gmail_offlineimap/)
    -   [Migrating from offlineimap to mbsync for mu4e | Pragmatic Emacs](http://pragmaticemacs.com/emacs/migrating-from-offlineimap-to-mbsync-for-mu4e/)


# Footnotes

<sup><a id="fn.1" href="#fnr.1">1</a></sup> Fastmail allows for a variety of interesting features like aliases, easy email transfer (from a different email provider like Gmail or MSN), responsive technical support, and many more aspects, and much more. They have their own implementation of the IMAP protocol, [called JMAP](https://www.fastmail.com/help/guides/interfaceupdate-2018.html#what-is-jmap), which is significantly faster.

<sup><a id="fn.2" href="#fnr.2">2</a></sup> While there are many advantages in Gmail and many swear by it's search capabilities - it is worth noting that Fastmail's ad-free interface and search just feels a lot quicker than Gmail, and I can find my way around the settings better than I used to with Gmail.

<sup><a id="fn.3" href="#fnr.3">3</a></sup> You may be surprised to see the ease in browsing a good number of websites on a text based web browser. Besides the added advantage of being within Emacs - a surprising number of websites can be viewed functionally on w3m. It works fine for quick searches on Google (which like anything else, can be done within a few key strokes in Emacs).