Archaic text based email clients rock!

This dev.to blog post 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.

Hope you find it entertaining. In any case, the links and reference section will certainly prove useful.

TLDR - for the busy folks

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.

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 from 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 section for almost all the resources I relied on.

A portion of my mu4e configuration is available on my website. The personal filters and configuration are placed in an encrypted file.

My mbsync configuration is posted as a public gist.

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.1,2

Creating sync channels via mbsync

My mbsync configuration is posted as a public gist. 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.

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, which uses the indexer mu as it’s back-end. There are other popular options like notmuch and mutt. 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.

Why mu4e rocks [for me] - the perks

The ability to create custom search filters that can be accessed with easy shortcuts. An example to demonstrate

(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:

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, 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 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.

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 or any other browser of your choice.3

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.

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’. Therefore a higher level of filters are implemented in Fastmail itself.

For example all Linked in group and job updates have their own folders. These folders are all subfolders 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 subfolders within the Archive folder, I can use a single channel for all the relatively unimportant mail.

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.

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!


  1. 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, which is significantly faster. ↩︎

  2. 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. ↩︎

  3. 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). ↩︎

Avatar
Shreyas Ragavan

Nerd | Technophile | Data Scientist

Related