我使用Mu4e。它有充分的文档记录(也通过Info),并且在撰写本文时,已得到积极开发。
Mu4e是作为mu的附件提供的,mu是“用于处理Maildirs和消息文件,特别是用于索引和搜索电子邮件的一组工具”。它与offlineimap或fetchmail一起使用。我还使用Emacs软件包smtpmail-multi,以便可以从具有不同设置的其他帐户发送邮件。为了与电子邮件提供商顺利集成,您应该apt-get install ca-certificates
。而且,如果您想使用软件包管理的版本,可以使用来获取mu本身apt-get install maildir-utils
。
提供了一些示例配置,包括以下“最小配置”:
(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")
依靠邮件提供商的设置,您将需要做更多的事情。特别是,您需要配置OfflineIMAP或Fetchmail才能实际检索邮件。在如下所示的配置中,我将所有内容设置为可以使用两个帐户。如果只需要从一个帐户取回,则可能要参考mu4e手册中包含的示例.offlineimaprc。
至于扩展和与其他Emacs的包集成:Mu4e方便地与组织模式集成(用于捕捉链接消息或自定义搜索,甚至使用组织语法编写HTML格式的电子邮件,我虽然不使用该功能)通过附带的组织-mu4e.el。有一个单独的helm-mu集成可用,但需要IMO做更多工作。它以solarized.el为主题。还有一个mu4e-maildirs-extension,可以方便地统计每个邮件目录中已读和未读邮件的数量,还有一些我还没有尝试过的东西。
这些示例配置与文档一起可以帮助一个新的mu4e用户起步。
.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 = other.e.mail@gmail.com
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 = username@campus.university.ac.uk
remotepass = TryAndGuess9876
ssl = yes
maxconnections = 1
realdelete = no
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
配置mu4e
和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 . ("username@campus.university.ac.uk"
"pod666.outlook.com"
587
"e.mail@uni.ac.uk"
nil nil nil nil))
(gmail . ("other.e.mail@gmail.com"
"smtp.gmail.com"
587
"other.e.mail@gmail.com"
starttls
nil nil nil)))))
(setq smtpmail-multi-associations
(quote
(("other.e.mail@gmail.com" gmail)
("e.mail@uni.ac.uk" 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 "other.e.mail@gmail.com")
(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 "other.e.mail@gmail.com" "e.mail@uni.ac.uk"))
(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 "other.e.mail@gmail.com")
(delete-region (match-beginning 0) (match-end 0))
(insert "e.mail@uni.ac.uk")
(buffer-face-set 'default))
((looking-at "e.mail@uni.ac.uk")
(delete-region (match-beginning 0) (match-end 0))
(insert "other.e.mail@gmail.com")
(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) "other.e.mail@gmail.com")
(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)
屏幕截图:使用搜索字词列表浏览:emacs-orgmode.gnu.org