在emacs 24中检查和发送电子邮件的当前权威方式是什么?
我检查了以下SO链接:
并了解其中涉及的软件包smtpmail,rmail以及.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)
(作为第二个链接, super 用户说。)
但是,当我运行
M-x rmail
时,它仍然连接到计算机的本地电子邮件地址,而不是我的gmail。我需要设置什么才能登录和读/写电子邮件? (如果您可以包括击键,那也将非常有帮助。)如果这有任何区别,我正在运行ubuntu 12.04。
最佳答案
在尝试了多种方法之后,我现在使用 offlineimap 在我的计算机和google服务器之间同步消息。 Gnus 然后从本地计算机读取消息。 后缀用于将邮件发送到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
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
发送邮件功能设置为'sendmail-send-it
用户邮件地址设置为“YourName@gmail.com”
最棘手的事情是设置Postfix,这是here的明确描述:
解决问题的进一步评论:
程序 offlineimap 由文件〜/ .offlineimaprc控制。当fineimap 的运行时,它将信息保存在〜/ .offlineimap目录中。您可以阅读文档以了解所有工作原理。
回复:发送邮件:实际上,我曾经直接从emacs发送邮件。这涉及摆弄许多事情。事实证明,让postfix处理它要容易得多。例如,我使用几个不同的电子邮件帐户从Gnus发送邮件。现在,我通过发布样式让gnus知道这一点,并让postfix担心应该将哪个地址发送到哪个服务器以及如何发送。
关于email - 在Emacs 24中阅读电子邮件(从Gmail),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/20979918/