offlineimap 报错

错误如下,不知道是不是要设啥证书。我在 ~/.offlineimaprc 里面把 ssl = yes 改为 no 也没用

gym@gymDeskGentoo ~ $ offlineimap ERROR: Default CA bundle was requested, but no existing locations available. Tried /, e, t, c, /, s, s, l, /, c, e, r, t, s, /, c, a, -, c, e, r, t, i, f, i, c, a, t, e, s, ., c, r, t. ERROR: Exceptions occurred during the run! ERROR: Default CA bundle was requested, but no existing locations available. Tried /, e, t, c, /, s, s, l, /, c, e, r, t, s, /, c, a, -, c, e, r, t, i, f, i, c, a, t, e, s, ., c, r, t.

Traceback: File “/home/gym/.local/lib/python3.8/site-packages/offlineimap/accounts.py”, line 278, in syncrunner self.remoterepos = Repository(self, ‘remote’) File “/home/gym/.local/lib/python3.8/site-packages/offlineimap/repository/init.py”, line 84, in new return repo(name, account) File “/home/gym/.local/lib/python3.8/site-packages/offlineimap/repository/IMAP.py”, line 42, in init self.imapserver = imapserver.IMAPServer(self) File “/home/gym/.local/lib/python3.8/site-packages/offlineimap/imapserver.py”, line 95, in init self.sslcacertfile = repos.getsslcacertfile() File “/home/gym/.local/lib/python3.8/site-packages/offlineimap/repository/IMAP.py”, line 271, in getsslcacertfile raise OfflineImapError(reason, OfflineImapError.ERROR.REPO)

问题背景:用 gnus 包收139邮件,没看到INBOX内容 - #10,来自 LdBeth

试下 emerge ca-certificates

那个包已经安装了,我用pudb 调试了一下,显然 /home/gym/.local/lib/python3.8/site-packages/offlineimap/utils/distro.py 文件里面有个bug啊,如下图

for f in l 那一行,看上去像是要检查每个文件是否存在,结果执行的时候为啥把一个文件路径拆成一个一个字符去检查,当然文件都不存在,可能因此也有了出错消息里面逗号分割的路径这么奇怪的错误内容。

这个会是啥情况?

去报个 bug。我没用过 offlineimap。我只用过 fetchmail, getmail,和 mailutils 的 movemail。

找一找系统上的 openssl cert bundle 在哪儿,然后在 .offlineimaprc 里指定一下,我是在 macOS 上用的 Homebrew 安装的 Pyhon3 和 openssl,这是我的配置:

sslcacertfile = /usr/local/etc/[email protected]/cert.pem

所以你应该给他个 list ? 比如 sslcacertfile = ["/usr/local/etc/[email protected]/cert.pem"] 这种?我乱猜的 :rofl:

我建了一新issue: Default CA bundle was requested, but no existing locations available. Tried /, e, t, c, /, s, s, l, · Issue #106 · OfflineIMAP/offlineimap3 · GitHub

我拭了下getmail, 也报错:

gym@gymDeskGentoo ~ $ getmail getmail version 6.14 Copyright (C) 1998-2020 Charles Cazabon and others. Licensed under GNU GPL version 2. SimplePOP3SSLRetriever:[email protected]@pop.139.com:995: read_all and not delete – all messages will be retrieved each time getmail is run SimplePOP3SSLRetriever:[email protected]@pop.139.com:995: getmailrc: socket error (EOF occurred in violation of protocol (_ssl.c:1147)) 0 messages (0 bytes) retrieved, 0 skipped

ym@gymDeskGentoo ~ $ cat /home/gym/.config/getmail/getmailrc

[retriever] type = SimplePOP3SSLRetriever server = pop.139.com username = [email protected] port = 995 password = ****

[destination] type = Maildir path = ~/mail/

看了一下我自己(曾经)的配置,写的是

sslcacertfile = /usr/local/etc/openssl/cert.pem

至少之前一直正常。

前面getmail 的错应该是139的pop3服务器的问题,换成imap就好了,用SimpleIMAPRetriever 就好了。加SSL还是不行,虽然 openssl s_client -connect imap.139.com:993 -starttls imap 可以连接,估计是python的问题。