在emacs 24中阅读电子邮件(来自gmail)

问题描述 投票:39回答:5

在emacs 24中检查和发送电子邮件的当前权威方式是什么?

我检查了以下SO链接:

  1. Setup for Gmail in Emacs VM
  2. https://superuser.com/questions/476714/how-to-configure-emacs-smtp-for-using-a-secure-server-gmail
  3. Which Emacs mail package should I use?

并了解包smtpmailrmail,以及.authinfo file

我创建了一个表单的.authinfo文件:

machine mail.example.org port 25 login myuser password mypassword

并将以下内容添加到我的init.el文件中:

(setq smtpmail-stream-type 'ssl)
(setq smtpmail-smtp-server "smtp.gmail.com")
(setq smtpmail-smtp-service 465)

(作为第二个链接,超级用户,说。)

但是,当我运行M-x rmail时,它仍然连接到我的计算机的本地电子邮件地址,而不是我的Gmail。设置登录和读/写电子邮件需要什么? (如果你可以包括击键,那也会非常有帮助。)

我正在运行ubuntu 12.04,如果这有任何区别的话。

email emacs smtp emacs24
5个回答
29
投票

尝试了很多方法后,我现在使用offlineimap在我的机器和谷歌服务器之间同步消息。然后Gnus从本地机器读取消息。 Postfix用于向gmail smtp服务器发送消息。此设置的优点:读取/发送电子邮件不涉及在gnus(快速)时等待服务器,可以在离线时读取/发送电子邮件(再次在线时传递给服务器)。如果你更喜欢使用RMail,你可以代替gnus。

这就是我在ubuntu 13.10上所做的。

offlineimap,定期运行将邮件放入〜/ Maildr / Gmail

〜/ .offlineimaprc的内容:

[general]
# List of accounts to be synced, separated by a comma.
accounts = Gmail
maxsyncaccounts = 2

[Account Gmail]
# Identifier for the local repository; e.g. the maildir to be synced via IMAP.
localrepository = Gmail-local
# Identifier for the remote repository; i.e. the actual IMAP, usually non-local.
remoterepository = Gmail-remote
# Status cache. Default is plain, which eventually becomes huge and slow.
status_backend = sqlite

[Repository Gmail-local]
type = Maildir
localfolders = ~/Maildir/Gmail

[Repository Gmail-remote]
type = Gmail
remoteuser = [email protected]
remotepass = YourPass
folderfilter = lambda foldername: foldername in ['INBOX', 'Dev']
# Necessary as of OfflineIMAP 6.5.4
sslcacertfile = /etc/ssl/certs/ca-certificates.crt

gnus从〜/ Maildir / Gmail读取邮件

在emacs中,变量gnus-home-directory设置为“〜/ Documents / gnus”。 “〜/ Documents / gnus / .gnus”的内容:

(setq gnus-select-method
      '(nntp "localhost")) ; I also read news in gnus; it is copied to my local machine via **leafnode**

(setq gnus-secondary-select-methods
      '((nnmaildir "GMail" (directory "~/Maildir/Gmail")) ; grab mail from here
    (nnfolder "archive"
      (nnfolder-directory   "~/Documents/gnus/Mail/archive") ; where I archive sent email
      (nnfolder-active-file "~/Documents/gnus/Mail/archive/active")
      (nnfolder-get-new-mail nil)
      (nnfolder-inhibit-expiry t))))

发送邮件:emacs配置变量:mail-user-agent设置为'gnus-user-agent send-mail-function设置为'sendmail-send-it用户邮件地址设置为“[email protected]

最棘手的是设置Postfix,这清楚地描述了here

解决问题的进一步意见:

程序offlineimap由文件〜/ .offlineimaprc控制。当offineimap运行时,它会将信息保存在目录〜/ .offlineimap中。您可以阅读文档以解释这一切是如何工作的。

Re:发送邮件:事实上,我曾经直接从emacs发送邮件。这涉及摆弄一些事情。事实证明,让postfix处理它会容易得多。例如,我使用几个不同的电子邮件帐户从Gnus发送邮件;我现在让gnus通过发布样式了解这一点,并让postfix担心哪个地址应该去哪个服务器,以及如何。


20
投票

确实mu4e是我的选择:http://www.djcbsoftware.nl/code/mu/mu4e.html

编辑:我也尝试了notmuchmail并使用mbsyncisync Debian软件包)获取电子邮件。当offlineimap需要配置步骤时,mbsync获得了开箱即用的证书支持。有人说它更可靠。我不喜欢这种对话的展示。

因此,mu4e使用offlineimap来获取邮件,使用mu对其进行索引,并使用mu4e在emacs中显示它。

甚至可以使用org-mode写富文本邮件!它仍然是实验性的,但here's an example关于如何包含数学公式和用python编写的情节。

PS:


4
投票

我不确定是否有“当前的权威方式”?

一定要看看http://www.emacswiki.org/emacs/CategoryMail

mu4e对我来说听起来很不错,但由于我从来没有真正为自己配置这类东西,我无法提出任何建议。

http://box.matto.nl/emacsgmail.html(对于Wanderlust客户)肯定是相关的。


3
投票

就像@Ehvince一样,我也推荐mu4e,尽管我现在只使用Gnus。 Mu4e非常易于设置/使用,方便,快捷,搜索/排序功能也很好。

虽然Wanderlust工作,但我发现它在安装方面有点麻烦。设置好之后,我创建了一个用于键绑定的备忘单,我在附近停留了一段时间。我不确定它是否得到了积极维护。

我听说过Mew但从未使用它。一个好处是,它似乎可以直接安装为一个包。

我回到了Gnus,因为它与Emacs捆绑在一起,不需要额外的软件。我目前的设置包括:Mairix(用于搜索),OfflineImap(用于提取邮件)。就像@Jeffrey一样,我也读过Gnus的新闻。


2
投票

正如其他人所说,没有一种“权威”方式可以做到这一点。多年来,我使用过VM,Gnus,MH-E和Wanderlust,更不用说一大堆非emacs邮件客户端了。

我喜欢尝试mu4e,基于我听到的所有伟大的事情,但使用offlineimap似乎打败了IMAP的目的,至少对于使用多台计算机。我真的不想在我的工作笔记本电脑,家用笔记本电脑和桌面上同步本地电子邮件副本。 (实际上,我的桌面上有MH格式的本地存储库,所以我可以将它转换为Maildir,但我的大部分邮件阅读都是从笔记本电脑上完成的。)

我目前正在使用Gnus直接与IMAP服务器通话。它在获取消息时有时会暂停,但总的来说,它非常敏感。我发现Wanderlust非常难以设置,并且一旦工作就很慢。

© www.soinside.com 2019 - 2024. All rights reserved.