在Arch下,我想使用offlineimap来像这样同步到GMail。
[general]
accounts = Gmail
maxsyncaccounts = 3
[Account Gmail]
localrepository = LocalGmail
remoterepository = RepositoryGmail
autorefresh = 30
quick = 10
postsynchook = mu index --maildir ~/.offlineimap/Gmail
[Repository LocalGmail]
type = GmailMaildir
localfolders = ~/.offlineimap/Gmail
[Repository RepositoryGmail]
type = Gmail
maxconnections = 2
remoteuser = my.gmail.accountname
remotepass = gmailapppassword
folderfilter = lambda foldername: foldername not in ['[Gmail]/All Mail', '[Gmail]/Important']
sslcacertfile = /etc/ssl/certs/ca-certificates.crt由于SSL出现问题而失败。
$ offlineimap -o -a Gmail
OfflineIMAP 7.2.1
Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
imaplib2 v2.57 (bundled), Python v2.7.15, OpenSSL 1.1.1a 20 Nov 2018
Account sync Gmail:
*** Processing account Gmail
Establishing connection to imap.gmail.com:993 (RepositoryGmail)
ERROR: Unknown SSL protocol connecting to host 'imap.gmail.com' for repository 'RepositoryGmail'. OpenSSL responded:
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)我在其他地方读到,我可以通过运行
$ openssl s_client -showcerts -connect imap.gmail.com:993
[...]
* OK Gimap ready for requests from 217.63.244.188 s26mb317463625edc在我看来,这个错误实际上不是在SSL连接中,而是在offlineimap处理它的方式上。证书文件存在并包含GlobalSign根CA - R2证书.
为了确保我已经安装了six,然后使用它们各自的pips将offlineimap安装到干净的python2.7和干净的python3.7虚拟主机中,CERTIFICATE_VERIFY_FAILED仍然存在。
我怎样才能离线与GMail交谈?
发布于 2019-02-14 10:40:07
在arch上,OpenSSL现在是1.1.1,这与imaplib2发生了冲突
https://github.com/imaplib2/imaplib2/issues/5
如下文所述:
https://github.com/OfflineIMAP/offlineimap/issues/573
您可以将ssl_version=tls1_2添加到.offlineimaprc中,这将解决这个问题。
https://unix.stackexchange.com/questions/487474
复制相似问题