Setting up Gmail in Doom Emacs using mbsync and mu4e
erichgrunewald.com
erichgrunewald.com
Long time ago, I used to read email using wanderlust on emacs. I remember I really liked it, it was very powerfull in handling email and it had really good imap (and offline) support. The only drawback was related to handling html email. Back then that was not that much of a problem because I used it for a lot of mailinglists which were typically text only, and the remaining email was often sent in both a text and a html version.
Anyone using email in emacs and has a good solution to deal with html email? Both receiving and sending? I kinda remember reading about people writing email in markdown and have it converted to html when sending it out.
I think this is the write-up I pulled these functions from: https://kitchingroup.cheme.cmu.edu/blog/2016/10/29/Sending-h...
Org-mode. Capturing whatever into the appropriate note is wonderful. These days about 80% of the time my answer to why Emacs is org-mode. Not that there aren't other great note taking options, but I've yet to find one that integrates so fully with, well, everything.
For all the doubters, I was right there with you 6 months ago. Who cares about yet another markdown clone am I right? Perhaps someone else can explain better, but in my case no amount of explanation really helped, I didn't get it until I did it.
Create a .org file and start writing is really the simplest. If you never make it past that, you still have an effective note taking system in Emacs.
The above should work for most tables, and you get back a pipe-separated-values output, that you could further refine with e.g. http://harelba.github.io/q/ to get tsv,csv output support and SQL query capabilities.
I regularly SQL-Query with INNER JOINs over tables in various org-files stored on multiple servers in one commandline using this combination.
John Kitchin has a description for a "cleaner" way to do it here: https://kitchingroup.cheme.cmu.edu/org/2014/08/11/Using-org-...
My scripts are a dirty combination of ideas/concepts of both of the above, that work for me depending on situation/use-case, but that I should clean up one day, and gist someplace. I can give more info, if the above doesn't give enough pointers yet for you to dig yourself further towards "your solution".
Here is how to do it in .mbsyncrc
https://gist.github.com/eddieh/8c853c6cf8ffb3ad87e0720eb50f8...
And here is how to do it in .msmtprc
https://gist.github.com/eddieh/5b4df4a8a98ea202e6ebb020871b0...
As noted in the .mbsyncrc gist:
> The value is "used to limit average bandwidth consumption (GMail may require this if you have a very fast connection)." Turns out the same is true for iCloud. There's probably some optimized value greater than "1" that can be used, but this works for me.
I actually have it set to 5 now.
* 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
I also feel like Spacemacs is growing faster and has more feature than Doom, because more dev's are working on Spacemacs. But I might be wrong about that.
[0] https://github.com/chenyanming/spacemacs_module_for_doom
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 seems to be much slower in doom than spacemacs). Other than that I found doom to be much easier to configure and much more configurable.
The major selling point for me was that in doom emacs there is much much less ceremony in wrapping a new package in a module, and more importantly it is _easier_ to reuse documentation for those packages because most packages provide configuration examples using `use-package` anyway. My only hangup was less documentation around writing custom modules which took me about a day to figure out (I would advise to just read some of the source code or mimic a module that doom ships with).
YMMV, but if you feel like you've attained a certain level of emacs maturity, I would 100% recommend trying it out. Be prepared that some modules, like the haskell module, don't ship with a lot of keybindings so you'll have to set those up yourself.
(setq which-key-idle-delay 0.1)
Really, I’m surprised we haven’t seen Prot on the front page here.
- Startup speed much quicker though I do use emacsclient so this is only an issue on first launch
- Overall feels a lot more snappy
- Simpler and more straight forward configuration
- Updates seem to break less (though sadly this isn’t reduced to zero, just reduced).
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...
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 voilà.
Edit: I refuse to use my Uni’s version of moodle for long-reply exams. Also using pdftools has changed my life.
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?
text/html; w3m -I %{charset} -T text/html; copiousoutput;
... in your .mailcap. The result is usually better than what ends up in in the text portion of dual text/html emails. Particularly nice when someone thinks they need html to show a table.I switched to mbsync and have had zero issues since. Just set it and forget it.
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.
Using mu4e, it is more of an interface to that local store with its built-in search API.
I've regularly waited up to a minute for an email I've just sent to arrive on someone else's account. A large part of this delay seems to be for some weird undo feature they've added which you can no longer fully disable.
parallel --bar -j0 mbsync "$@" <<EOF
mail1
mail2
mail3
EOFSo, yeah, "Advanced Protection" offerings would be good. Looks like I could make my own app that uses open id to connect?
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.