Contents
- TLDR - for the busy folks
- Multiple email accounts. Lack of a unified interface.
- Creating sync channels via
mbsync
- Text based email client! Speed + simplicity
- Why mu4e rocks [for me] - the perks
- Quirksx
- Multiple levels of filters are still necessary.
- Takeaways
- Links and References
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.
How I unified my email accounts in 2019
Mohammed Ismail Ansari ・ Jul 12 '19
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.
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:
- Started with 2 Gmail accounts and 1 MSN account.
- Switched to a paid account with Fastmail.
- Used Fastmail's tools to transfer email from both Gmail and MSN accounts.
- Setup forwarding for all new emails to Fastmail.
- Decided between retaining copies of emails in Gmail/MSN or deleting them once forwarded.
- Used customised settings in mu4e to manage Email from within Emacs.
- Occasionally rely on web browser / iOS app. Fastmail's interface is clean and very fast.
- 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 also shared for reference.
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 (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:
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', 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.
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.
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, <2017-03-08 Wed 10:04>
- Reading IMAP Mail in Emacs on OSX | Adolfo Villafiorita, <2016-11-27 Sun 08:17>
- [ ] Excellent link talking about mu4e and notifications Handling Email with Emacs – malb::blog, <2016-08-01 Mon 18:37>
- Which email client (mu4e, Mutt, notmuch, Gnus) do you use inside Emacs, and why? : emacs <2016-05-31 Tue 07:32>
- emacs-fu: introducing mu4e, an e-mail client for emacs - Emacs and mu4e stuff <2016-04-20 Wed 13:02>
- Emacs as email client with offlineimap and mu4e on OS X / KG / Hacks. Thoughts. Writings. - nice blog related to Emacs and linux <2016-04-21 Thu 22:44>
- EOS: Mail (Email) Module - explaining multiple email setup in mu4e <2016-04-27 Wed 07:56>
- The Ultimate Emailing Agent with Mu4e and Emacs – Emacs, Arduino, Raspberry Pi, Linux and Programming etc, <2016-08-17 Wed 13:19>
- Varun B Patil | EOM a.k.a End of Mail a.k.a Emacs + offlineimap + mu4e - multiple accounts <2016-04-19 Tue 12:19>
- Master your inbox with mu4e and org-mode | Pragmatic Emacs <2016-03-26 Sat 14:56>
- notmuch - email setup My personal mail setup — Articles — WWWTech <2017-06-13 Tue 16:09>
- Search-oriented tools for Unix-style mail | Mark J. Nelson, <2017-05-10 Wed 16:29>
- 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, <2017-04-28 Fri 07:19>
- interesting link, author profile and content available on-line.
- Assorted Nerdery - Notmuch of a mail setup Part 2 - notmuch and Emacs, <2017-04-27 Thu 18:41>
- Mutt, mu4e and notmuch links
- bash - Send Html page As Email using "mutt" - Stack Overflow
- Reading html email with mutt
- Prefer plain text format over HTML in mutt
- Using emacs and notmuch as a mail client - Foivos . Zakkak . net
- Help with mu4e multiple accounts : emacs
- Using Mutt, OfflineIMAP and Notmuch to wrangle your inbox. : linux <2016-06-16 Thu 15:23>
- A year with Notmuch mail {LWN.net} <2018-04-17 Tue 01:21>
- mu4e specific Links <2016-04-19 Tue 21:48>
- Mu4e 0.9.16 user manual: Gmail configuration
- mu4e tutorials - Google Search
- Tutorial: email in Emacs with mu4e and IMAP+SSL : emacs
- mu4e tutorials | Pragmatic Emacs
- Drowning in Email; mu4e to the Rescue.
- Emacs & the obsessive email mongerer | Moved by Freedom – Powered by Standards
- Mu4e + nullmailer - Google Groups
- Leaving Gmail Behind « null program
- view html mails in mu4e - Google Search
- Mu4e 0.9.16 user manual: Reading messages
- In mu4e, is this how your HTML-heavy emails render? : emacs
- Varun B Patil | EOM a.k.a End of Mail a.k.a Emacs + offlineimap + mu4e
- Mu4e 0.9.16 user manual: Marking messages
- change the date column format in mu4e - Google Search
- Mu4e 0.9.16 user manual: HV Overview
- increase column size in mu4e - Google Search
- Mu4e 0.9.16 user manual: HV Custom headers
- mu4e-manual-0.9.9.pdf
- do mu4e folders sync with gmail folders - Google Search
- mu4e Send mail with custom SMTP and archive in Gmail "Sent" folder : emacs
- Using mu4e · Brool
- are maildir folders synced back to gmail ? - Google Search
- Some real use cases
- About
- Backing up Gmail messages with offlineimap
- notmuch email versus mu4e - Google Search
- Which email client (mu4e, Mutt, notmuch, Gnus) do you use inside Emacs, and why? : emacs
- A Followup on Leaving Gmail | Irreal
- Sup?
- Mutt + Gmail + Offlineimap
- Migrating from offlineimap to mbsync for mu4e | Pragmatic Emacs
Footnotes
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).
Top comments (8)
Hey there,
Just a quick question: Great post and it made me think about switching to Fastmail as well. I've been asking them questions via email since last night (since reading your post) and they seem very good. Are there any obvious advantages from going from Gmail to Fastmail in terms of using mu4e? I was using mu4e for a while, but I stopped because it wasn't always working 100% with Gmail. Recently, I fired it back up (after about 2 months of not using it and a big Mac update) and it had completely stopped working. I rebuilt the mu database, but it won't pull mail, giving me all sorts of weird errors. I'll have to reinstall it, but it was such a pain to get working with Gmail last time that I was thinking perhaps it's time I moved anyway. So I'm just looking for an excuse, I suppose. Any input would be valuable.
Also, I followed you and joined the dev.to site. Thanks! :D
Now to figure out if there is RSS because I use Elfeed in Emacs flawlessly since months...with everything worked that way.....
It's been awhile since I explored this aspect. I apologise if my answers lack specifics. It has actually been years since I composed email in Gmail. :) Check out this article > maxmasnick.com/2013/07/19/fastmail/, which is old, but probably answers your questions a bit.
Before using fastmail, I was using mu4e for multiple gmail accounts. I think I did get it working satisfactorily via some 'context' approach in mu4e, (if I remember correctly), but then I wanted to cover my 'live.in' account as well. There also were some other limitations that I don't recall.
Additionally, the .mbsyncrc file would be complex for multiple accounts, then add to that maintaining multiple passwords, and email signatures, and then configuring which email address to reply from etc.
IMO - mu4e's strength/purpose is in searching, and setting up custom pre-set search filters. The email sync itself is via mbsync / offlineimap. If you see my .mbsyncrc above, you'll see it is possible to search and sync specific folders with a search pattern. I'm not sure if that can be done with Gmail, since there are no folders at all (?).
Fastmail uses the conventional folder based IMAP approach, as against the tag based approach of Gmail. This makes it easier w.r.t mbsync/offlineimap, and all other tools designed around IMAP, which is the actual gateway, rather than mu, which is an indexer, and mu4e which is an interface for mu in emacs.
As such - all my emails are forwarded to fastmail, but copies are still retained in the gmail/live.in mailboxes today. I'll probably wipe out those inboxes sometime in the future. For the money you pay with fastmail, you can setup different 'aliases' - which is a lot better than different email accounts. Overall - I instantly liked fastmail's 'no-unnecessary-frills' interface and of course the absence of ads.
Thanks for the reply! I'm going to be moving my mail in the coming weeks to test it. I have a few things to do first to set up as it's a pretty big undertaking for me. I was one of the first Gmail users as a friend of mine was working for them when they opened beta, so I've been with them since well over 15 years now. I just need time to organize how to do it all with my various gmail accounts - something which I shall organize in an org-mode list of course. :)
Hey there,
I got fastmail but I ran into all kinds of problems with mu4e. I added it to my mbsync and msmtp config and my mu4e config, but it broke everything. Now, I can't send with gmail or fastmail :/ It's a mess. Not sure what to do. mu4e is essentially broken. I may just revert back to the gmail config for now until I figure it out, but I tried everything for a full 7 hours and it drove me nuts.
If you have any advice (I'm on a Macbook) it would be gratefully appreciated. I'd love to keep both configs but if I can't, maybe I should just go with fastmail. The thing is, I tried just mbsync and it won't even log in properly with mbsync -a. It gives me a locked out thing. I set up the password properly via their web site for mbsync, emacs, and msmtp (each with its own password), and still no go. :/
I'm not sure what exactly the error is.
AFAIK : only a single app-specific password is required from fastmail, and I used that with mbsync as well as postfix. I consolidated my notes into this public gist. It is an org file - and so you should be able to execute many of the code blocks directly in Emacs.
gist.github.com/shrysr/8c239fcbf1d...
I would also suggest using the org file as a starting point to store your configuration steps and notes. Somewhere along the line, i made this - and used it to setup my email on a new mac pretty quickly.
Also - if you have forwarded all your past gmail stuff into fastmail - you need not hold on to the gmail mbsync config, because you will have all your email available already.
If you want both configs - i think how I did it was to use separate .mbsyncrc files for each gmail account to sync mail. like .mbsyncrc1 and .mbsyncrc2, which need to refer to their corresponding password files. These were synced to say gmail1 and gmail2 folders locally. THen I used a single mu index for both gmail1 and gmail2. Further setup probably requires the context thingy in mu4e.
Aha! NEVER MIND! IT WORKS! :D I got it to work. YES! It was a combination of stupid things. Authinfo was set up incorrectly, too little info was set up in contexts in mu4e, and a bunch of other niggling stuff. But I got it to work. YES! Woohoo! YES! Lol. After 3 days of tearing out my hair, it works beautifully. Now I can test it out and see if I want to buy the plan. Thanks for post again - it ended up helping tremendously with all the links and your post btw. I couldn't have done it without that.
Here you go, and thanks again:)
neurolog.dev/log/going_full_fastmail/