I use Mu4e. It is well documented (also via Info), and as of this writing, actively developed.
Mu4e is shipped as an add-on to mu, "a set of tools to deal with Maildirs and message files, in particular to index and search e-mail messages". It works together with offlineimap or fetchmail. I also use the Emacs package smtpmail-multi so that I can send from different accounts with different settings. For smooth integration with your email provider, you should apt-get install ca-certificates
. And if you want a package-managed version, you can grab mu itself with apt-get install maildir-utils
.
Several example configurations are supplied, including the following "minimal configuration":
(require 'mu4e)
(setq message-send-mail-function 'smtpmail-send-it
smtpmail-default-smtp-server "smtp.example.com"
smtpmail-smtp-server "smtp.example.com"
smtpmail-local-domain "example.com")
Depinding on the set-up of your mail provider, you will need to do a bit more; and in particular, you will need to configure OfflineIMAP or Fetchmail to actually retrieve the mail. In my configuration, shown below, I set everything up to work with two accounts. If you just need to retrieve from one account, you may want to refer to the sample .offlineimaprc included in the mu4e manual.
As for extensions and integration with other Emacs packages: Mu4e integrates conveniently with Org Mode (for capturing links to messages or custom searches, and even for authoring HTML formatted emails using Org syntax, although I don't use that feature) via the included org-mu4e.el. There is a separate helm-mu integration that is usable, but needs some more work IMO. It is themed in solarized.el. There is also a mu4e-maildirs-extension that gives a convenient count of read and unread messages per mail directory, and there is some other stuff I haven't tried.
Together with the docs, these sample configs may help a new mu4e user get off the ground.
.offlineimaprc
[general]
accounts = Gmail, Uni
maxsyncaccounts = 3
[Account Gmail]
localrepository = Local
remoterepository = Remote
status_backend = sqlite
[Repository Local]
type = Maildir
localfolders = ~/Maildir/google
[Repository Remote]
type = IMAP
remotehost = imap.gmail.com
remoteuser = [email protected]
remotepass = TryAndGuess12345
ssl = yes
maxconnections = 1
realdelete = no
# cert_fingerprint = fa88366ccd90cd02f7a5655800226c43c8044ada
# but they change all the time, so...
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
# Folders to get:
#
# In Gmail, filter all current mail that isn't *otherwise*
# filtered into the folder or folders you want to receive/sync.
# Keep that up to date; it will boost efficiency if you would
# otherwise be syncing a very large "Inbox" here.
folderfilter = lambda foldername: foldername in [
'JUNE2015', 'Drafts', 'Sent']
[Account Uni]
localrepository = UniLocal
remoterepository = UniRemote
status_backend = sqlite
[Repository UniLocal]
type = Maildir
localfolders = ~/Maildir/uni
[Repository UniRemote]
type = IMAP
remotehost = pod666.outlook.com
remoteuser = [email protected]
remotepass = TryAndGuess9876
ssl = yes
maxconnections = 1
realdelete = no
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
Config for mu4e
and smtpmail-multi
:
;;; Replies
(setq message-citation-line-function 'message-insert-formatted-citation-line)
(setq message-citation-line-format "On %a, %b %d %Y, %f wrote:\n")
;;; smtp
(add-to-list 'load-path "~/smtpmail-multi")
(require 'smtpmail-multi)
(require 'smtpmail)
(setq smtpmail-multi-accounts
(quote
((uni . ("[email protected]"
"pod666.outlook.com"
587
"[email protected]"
nil nil nil nil))
(gmail . ("[email protected]"
"smtp.gmail.com"
587
"[email protected]"
starttls
nil nil nil)))))
(setq smtpmail-multi-associations
(quote
(("[email protected]" gmail)
("[email protected]" uni))))
(setq smtpmail-multi-default-account (quote gmail))
(setq message-send-mail-function 'smtpmail-multi-send-it)
(setq smtpmail-debug-info t)
(setq smtpmail-debug-verbose t)
;;; MU4E config
(require 'shr)
(defun shr-render-current-buffer ()
(shr-render-region (point-min) (point-max)))
(setq mu4e-compose-dont-reply-to-self t)
(setq mu4e-compose-signature-auto-include nil)
(setq mu4e-html2text-command 'shr-render-current-buffer)
(setq mu4e-mu-binary "~/mu/mu/mu")
(setq user-full-name "Hello World")
(setq user-mail-address "[email protected]")
(setq mu4e-hide-index-messages t)
(setq
mu4e-maildir "~/Maildir" ;; top-level Maildir
mu4e-sent-folder "/sent" ;; folder for sent messages
mu4e-drafts-folder "/drafts" ;; unfinished messages
mu4e-trash-folder "/trash" ;; trashed messages
mu4e-refile-folder "/archive") ;; saved messages
(setq
mu4e-get-mail-command "offlineimap" ;; -a Uni to just do university acc't
mu4e-update-interval nil) ;; 300 to update every 5 minutes
(setq mu4e-bookmarks
'( ("flag:unread AND NOT flag:trashed" "Unread messages" ?u)
("date:today..now" "Today's messages" ?t)
("date:7d..now" "Last 7 days" ?w)
("date:1d..now AND NOT list:emacs-orgmode.gnu.org" "Last 1 days" ?o)
("date:1d..now AND list:emacs-orgmode.gnu.org" "Last 1 days (org mode)" ?m)
("maildir:/sent" "sent" ?s)
("maildir:/uni/INBOX AND date:7d..now" "University Last 7 days" ?g)
("maildir:/google/JUNE2015 AND date:7d..now" "Gmail Last 7 days" ?c)
("mime:image/*" "Messages with images" ?p)))
(setq mu4e-maildir-shortcuts
'( ("/google/JUNE2015" . ?c)
("/uni/INBOX" . ?g)
("/sent" . ?s)))
(setq mu4e-user-mail-address-list (list "[email protected]" "[email protected]"))
(setq message-kill-buffer-on-exit t)
(setq
mu4e-view-show-images t
mu4e-view-image-max-width 800)
;; A little demo function for switching accounts
(defun switch ()
(interactive)
(save-excursion (goto-char (point-min))
(forward-char 19)
(cond
((looking-at "[email protected]")
(delete-region (match-beginning 0) (match-end 0))
(insert "[email protected]")
(buffer-face-set 'default))
((looking-at "[email protected]")
(delete-region (match-beginning 0) (match-end 0))
(insert "[email protected]")
(buffer-face-set 'bold-italic))
(t nil))))
(add-hook 'mu4e-compose-mode-hook (lambda () (buffer-face-set 'bold-italic)))
;;; Saving outgoing mail
;; Following tip from documentation for `mu4e-sent-messages-behavior' - see also
;; http://www.djcbsoftware.nl/code/mu/mu4e/Saving-outgoing-messages.html
;; for some related points, but not necessary to do things both ways.
(setq message-sendmail-envelope-from 'header)
(setq mu4e-sent-messages-behavior
(lambda ()
(if (string= (message-sendmail-envelope-from) "[email protected]")
(progn (message "Delete sent mail.")
'delete)
(progn (message "Save sent mail.")
'sent))))
;;; Org mode compatibility
;; Use `org-store-link' to store links, and `org-insert-link' to paste them
(require 'org-mu4e)
;;; That's all
(provide 'my-mu4e-config)
screenshot: browsing with search term list:emacs-orgmode.gnu.org