Live data from Hacker News

Setting up Gmail in Doom Emacs using mbsync and mu4e

erichgrunewald.com

31–40 of 50 posts

Re: Setting up Gmail in Doom Emacs using mbsync and mu4e

#31

Has anyone switched from Spacemacs to Doom Emacs? Are there special advantages Doom offers that make this switch worthwhile?

I can confirm a lot of what has already been said. I've used spacemacs since 2017, have contributed to it, and have written several private layers for it, such as a custom org layer. But I switch to Doom emacs literally two weeks ago and I'm never going back. I find doom to be much faster not just startup time but in general responsiveness (one major exception: hitting SPC and waiting for key binding tips to show see…

Thanks for your answer.

Re: Setting up Gmail in Doom Emacs using mbsync and mu4e

#32
I'm comfortable with Emacs for programming, Org and RSS.

I've tried using email from Emacs a number of times, but never had a setup that I stick with.

All modes that used IMAP would block.

notmuch.el was nice but distributed read-state between two DBs, which felt brittle.

I use Thunderbird. I'm keen to use email from Emacs, if I can find a decent solution.

Re: Setting up Gmail in Doom Emacs using mbsync and mu4e

#33
post #4

I'm very happy with mbsync and mu4e. The only drawback is that email fetching+indexing can be very slow (10 to 30 seconds), compared with the instantaneous gmail web interface. I'm not sure if this is poor configuration on my side, or some other bottlenecks (mbsync, mu indexing, IMAP protocol).

I've found the sequential syncing with mbsync to be a major bottleneck. These days instead of "mbsync -a" I have a script like this, using GNU Parallel:

    parallel --bar -j0 mbsync "$@" 

Re: Setting up Gmail in Doom Emacs using mbsync and mu4e

#34
post #5

I've been using Neomutt for some time now and I'm already contemplating ditching it. Fewer emails these days are purely text, viewing them brings me right back to the browser anyways. Never got into the Org-Mode hype for Doom Emacs. I do love Magit though, it remains the best git tool I've used to date, but the pain of wrestling with some of my lsp plugins (Looking at ESS) has made waste more time than anything.

mu4e is mail on steroids. If you need to automate anything you can grok a small script in an afternoon (much less if you are familiar with elisp) and have it work for you in ways no other mail agent will. My need: write personalized exams for my (50-ish) students, send an email for each with his respective exam, and upon receiving the replies, save each attachment in its own directory. Some perl+latex+mu4e+elisp ans…

> mu4e is mail on steroids. If you need to automate anything you can grok a small script in an afternoon (much less if you are familiar with elisp)

It’s not a very good sales pitch to claim that automating anything needs a script and then even an afternoon to do it. Like I really hope that simple filter rules take at most a minute not hours. :-)

> and have it work for you in ways no other mail agent will.

How does it compare to Gnus?

Re: Setting up Gmail in Doom Emacs using mbsync and mu4e

#35

I'm comfortable with Emacs for programming, Org and RSS. I've tried using email from Emacs a number of times, but never had a setup that I stick with. All modes that used IMAP would block. notmuch.el was nice but distributed read-state between two DBs, which felt brittle. I use Thunderbird. I'm keen to use email from Emacs, if I can find a decent solution.

Better to just have two or more Emacs processes running. One for programming, one for email, one for Elfeed. If I had to check email in Emacs, I might do it this way, but like you I just use Tbird and Emacs.

Re: Setting up Gmail in Doom Emacs using mbsync and mu4e

#36
post #30
post #27

Earlier quoted context omitted.

It is silly, as I think that is disabled if you have "Advanced Protection" turned on. Which... is what I thought they now called 2-step. Seems it is 2-step+? So, yeah, "Advanced Protection" offerings would be good. Looks like I could make my own app that uses open id to connect?

This is possible with mbsync. Take a look at Archlinux wiki page for mbsync.

The page I found assumes you can get an app password. Those are disabled in advanced. Am I looking at wrong page?

Re: Setting up Gmail in Doom Emacs using mbsync and mu4e

#37
post #23

Has anyone here used both offlineimap and mbsync and can speak to how these two compare?

I switched to mbsync from offlineimap about four years ago. I was having issues with offlineimap hanging during sync, as well as slow performance in general. I switched to mbsync and have had zero issues since. Just set it and forget it.

mbsync tends to be more efficient and robust. With Gmail it has no problems. With outlook IMAP it has problems with some emails occasionally. I haven’t figured out how to sync Maildir with Office365 other than cloud-mdir-sync which is inefficient for large mail boxes.

Re: Setting up Gmail in Doom Emacs using mbsync and mu4e

#38
post #36
post #30

Earlier quoted context omitted.

This is possible with mbsync. Take a look at Archlinux wiki page for mbsync.

The page I found assumes you can get an app password. Those are disabled in advanced. Am I looking at wrong page?

I used mbsync like this: https://wiki.archlinux.org/title/Isync#Using_XOAUTH2

On Fedora, I think I had to dnf install "isync" (for mbsync) and "libkgapi" (for the SASL XOAUTH2 plugin) and also pip install "oauth2token".

You'll need to get credentials from Google. I think this describes how: https://developers.google.com/identity/protocols/oauth2

If you have a plain gmail account (instead of Google Workspace, or whatever it's called now), one irritating thing is that you have to renew the access tokens (using oauth2create) once a week.

Re: Setting up Gmail in Doom Emacs using mbsync and mu4e

#39
If anyone wants to try email in Emacs, two very productive options I used, years ago were:

* VM https://www.nongnu.org/viewmail/

* Gnus https://www.gnus.org/

I don't know about the current security of these.

I used both of them with BBDB contacts database (which I found much more useful than anything that JWZ's employer did with addressbooks, then or since): https://www.jwz.org/bbdb/ https://www.emacswiki.org/emacs/CategoryBbdb

Re: Setting up Gmail in Doom Emacs using mbsync and mu4e

#40
Great write up! I would suggest using OAuth2 rather than the Less Secure App settings (https://cashweaver.com/blog/read-email-in-emacs-with-mbsync-...).

I also wrote up a guide for using notmuch, which has quickly become my preferred emacs email solution: https://cashweaver.com/blog/read-email-from-gmail-with-notmu...

Post reply on HN