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

Mit*_*ops 40 email emacs smtp emacs24

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

我检查了以下SO链接:

  1. 在Emacs VM中设置Gmail
  2. https://superuser.com/questions/476714/how-to-configure-emacs-smtp-for-using-a-secure-server-gmail
  3. 我应该使用哪个Emacs邮件包?

并了解包含smtpmail,rmail,以及.authinfo文件软件包.

我创建了一个表单的.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)
Run Code Online (Sandbox Code Playgroud)

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

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

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

Jef*_*Leo 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 = YourName@gmail.com
remotepass = YourPass
folderfilter = lambda foldername: foldername in ['INBOX', 'Dev']
# Necessary as of OfflineIMAP 6.5.4
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
Run Code Online (Sandbox Code Playgroud)

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))))
Run Code Online (Sandbox Code Playgroud)

发送邮件:emacs配置变量: mail-user-agent设置为'gnus-user-agent send-mail-function设置为'sendmail-send-it 用户邮件地址设置为"YourName@gmail.com"

最棘手的是设置Postfix,这里有清楚的描述:

解决问题的进一步意见:

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

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

  • 我强烈建议尝试[isync](http://isync.sourceforge.net/)作为offlineimap的替代方案.它要快得多. (2认同)

Ehv*_*nce 20

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

因此,mu4e使用offlineimap来获取邮件,isync将其编入索引并使用mu4e在emacs中显示它.

甚至可以使用org-mode编写富文本邮件!它仍然是实验性的,但这里是一个关于如何包含数学公式和用python编写的图的示例.

PS:

在此输入图像描述