首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >脱机同步和读取Gmail,使用isync或offlineimap

脱机同步和读取Gmail,使用isync或offlineimap
EN

Stack Overflow用户
提问于 2015-12-13 00:15:55
回答 1查看 3K关注 0票数 3

我的目标是同步我的电子邮件从一个Gmail帐户和索引,以搜索和阅读在Emacs。后者还没有意义,因为我无法让电子邮件同步到我的笔记本电脑。

我在经营小牛,所以在Mac终端工作。

我跟踪了SO accepted answer and the answer in the same thread试图使用offlineimap,以及this (more promising) tutorial on using 中的第二个方法(也就是mbsync)。这两种方式最后都使用了mu和Emacs的接口:mu4e

证书未被正确读取/解释。我不知道为什么,因为我不理解错误信息。这是离线地图上的一张:

代码语言:javascript
复制
> OfflineIMAP 6.5.7
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
Account sync Gmail:
 *** Processing account Gmail
 Establishing connection to imap.gmail.com:993
 PLAIN authentication failed: [ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure)
 LOGIN authentication failed: [ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure)
 ERROR: All authentication types failed:
    PLAIN: [ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure)
    LOGIN: [ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure)
 *** Finished account 'Gmail' in 0:01
ERROR: Exceptions occurred during the run!
ERROR: All authentication types failed:
    PLAIN: [ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure)
    LOGIN: [ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure)
> 
> Traceback:   File
> "/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/accounts.py",
> line 263, in syncrunner
>     self.__sync()   File "/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/accounts.py",
> line 326, in __sync
>     remoterepos.getfolders()   File "/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/repository/IMAP.py",
> line 351, in getfolders
>     imapobj = self.imapserver.acquireconnection()   File "/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/imapserver.py",
> line 451, in acquireconnection
>     self.__authn_helper(imapobj)   File "/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/imapserver.py",
> line 366, in __authn_helper
>     "failed:\n\t%s"% msg, OfflineImapError.ERROR.REPO)

这是mbsync的

代码语言:javascript
复制
> C: 0/3  B: 0/2  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0
Error while loading certificate file '/usr/local/etc/openssl/certs/Equifax.crt': error:00000000:lib(0):func(0):reason(0)
C: 3/3  B: 0/2  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0

我已经安装了所有与家庭自制,并正在使用的文件夹,根据教程。问题来自于证书,但我不知道问题可能是什么。我有Gmail内的设置,允许IMAP,也允许不太安全的应用程序的连接。

如何以不同的方式处理证书?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-02-06 05:44:48

对于离线映射错误,谷歌抱怨你没有使用Oauth2。在下面的解释中,我通过了同样的离线映射问题:https://github.com/OfflineIMAP/offlineimap/issues/228

您需要将.offlineimaprc配置为使用Oauth2,而不是指定用户名/密码。下面是关于如何生成令牌的模板和说明:https://github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf#L764

以下是重要的设置:

代码语言:javascript
复制
auth_mechanisms = GSSAPI, CRAM-MD5, XOAUTH2, PLAIN, LOGIN
oauth2_client_secret = ...
oauth2_client_id = ...
oauth2_refresh_token = ...
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34246542

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档