iobates avatar

Email in Emacs

iobates

Published: 14 Feb 2021 › Updated: 14 Feb 2021Email in Emacs

Email in Emacs

emacs_logo.png

You will need to install mu, preferably from source since this will dump the emacs source under

/var/local/share/emacs/site-lisp/mu4e/

which you need to add to the load path.

(add-to-list load-path "/usr/local/share/emacs/site-lisp/mu4e")

With this done there is just a bit of configuration needed.

(setq message-send-mail-function 'smtpmail-send-it
    smtpmail-auth-credentials "~/.authinfo" ;; Here I assume you encrypted the credentials
    smtpmail-smtp-server YOURSERVICECONFIG
    smtpmail-smtp-service YOURSERVICEPORT
    user-mail-address YOUREMAIL
    user-full-name YOURNAME)

(setq mu4e-maildir "~/Mail"
mu4e-attachment-dir "~/Downloads"
mu4e-sent-folder "/Sent"
mu4e-drafts-folder "/Drafts"
mu4e-trash-folder "/Trash"
mu4e-refile-folder "/Archive")

This is more of less the necessary setup to have your email working inside emacs.

From here you should be good to go.

There is the small detail of actually retrieving your email from the server, but that is not covered here. I was mostly concerned with getting emacs to do the right thing. I suggest you check out eithermbsync or offlineimap, offlineimap is the worst of the two due to it being slower and sucking up a lot more resources, the consequence of it being written in python (when mbsync is c as far as I know).

Leave Email in Emacs to:

Written by

Working on some projects, and taking a small vacation.

Read more #emacs posts


Best Posts From iobates

We have not curated any of iobates's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From iobates