OfflineIMAP 和本地颁发者证书 - 未知的 SSL 协议

OfflineIMAP 和本地颁发者证书 - 未知的 SSL 协议

我使用的是 Debian 12 GNU/Linux 操作系统。我想在 OfflineIMAP 中设置两个邮箱:Gmail 和 STCable。我的 offlineimaprc 文件的内容如下:

[general]
accounts = gmailfiokom,stcablefiokom
maxsyncaccounts = 1

# Gmail ##################
[Account gmailfiokom]
localrepository = gmailhelyben
remoterepository = gmailtavol

[Repository gmailhelyben]
type = GmailMaildir
localfolders = /home/$USER/mail/[email protected]

[Repository gmailtavol]
type = Gmail
maxconnections = 1
remotehost = imap.gmail.com
remoteuser = [email protected]
remotepass = ****************
ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt

# STCable #################
[Account stcablefiokom]
localrepository = stcablehelyben
remoterepository = stcabletavol

[Repository stcablehelyben]
type = Maildir
localfolders = /home/$USER/mail/[email protected]

[Repository stcabletavol]
type = IMAP
starttls = yes
auth_mechanisms = LOGIN
maxconnections = 1
remotehost = imap.stcable.net
remoteuser = [email protected]
remotepass = ****************
ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt

当我运行 offlineimap --dry-run 命令时,输出如下:

OfflineIMAP 8.0.0
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
imaplib2 v3.05, Python v3.11.2, OpenSSL 3.0.11 19 Sep 2023
Account sync gmailfiokom:
 *** Processing account gmailfiokom
 Establishing connection to imap.gmail.com:993 (gmailtavol)
 [DRYRUN] Creating folder [Gmail].&ANY-sszes lev&AOk-l[gmailhelyben]
 [DRYRUN] Creating folder [Gmail].Csillagozott[gmailhelyben]
 [DRYRUN] Creating folder [Gmail].Elk&APw-ld&APY-tt levelek[gmailhelyben]
 [DRYRUN] Creating folder [Gmail].Fontos[gmailhelyben]
 [DRYRUN] Creating folder [Gmail].Kuka[gmailhelyben]
 [DRYRUN] Creating folder [Gmail].Piszkozatok[gmailhelyben]
 [DRYRUN] Creating folder [Gmail].Spam[gmailhelyben]
 [DRYRUN] Creating folder Arduino[gmailhelyben]
 [DRYRUN] Creating folder C64[gmailhelyben]
 [DRYRUN] Creating folder Drafts[gmailhelyben]
 [DRYRUN] Creating folder INBOX[gmailhelyben]
 [DRYRUN] Creating folder Iskola[gmailhelyben]
 [DRYRUN] Creating folder Junk[gmailhelyben]
 [DRYRUN] Creating folder Nemzeti Regiszter[gmailhelyben]
 [DRYRUN] Creating folder Nemzeti V&AOE-laszt&AOE-si Iroda[gmailhelyben]
 [DRYRUN] Creating folder Queue[gmailhelyben]
 [DRYRUN] Creating folder Sent[gmailhelyben]
 [DRYRUN] Creating folder Trash[gmailhelyben]
 ERROR: getfolder() asked for a nonexisting folder '[Gmail].&ANY-sszes
lev&AOk-l'.
 *** Finished account 'gmailfiokom' in 0:01
Account sync stcablefiokom:
 *** Processing account stcablefiokom
 Establishing connection to imap.stcable.net:993 (stcabletavol)
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to
get local issuer certificate (_ssl.c:992)
 *** Finished account 'stcablefiokom' in 0:00
ERROR: Exceptions occurred during the run!
ERROR: getfolder() asked for a nonexisting folder '[Gmail].&ANY-sszes
lev&AOk-l'.

Traceback:
  File "/usr/share/offlineimap3/offlineimap/accounts.py", line 298, in
syncrunner
    self.__sync()
  File "/usr/share/offlineimap3/offlineimap/accounts.py", line 405, in __sync
    localfolder = self.get_local_folder(remotefolder)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/offlineimap3/offlineimap/accounts.py", line 326, in
get_local_folder
    return self.localrepos.getfolder(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/offlineimap3/offlineimap/repository/Maildir.py",
line 165, in getfolder
    raise OfflineImapError("getfolder() asked for a nonexisting "

ERROR: Unknown SSL protocol connecting to host 'imap.stcable.net' for
repository 'stcabletavol'. OpenSSL responded:
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to
get local issuer certificate (_ssl.c:992)

Traceback:
  File "/usr/share/offlineimap3/offlineimap/accounts.py", line 298, in
syncrunner
    self.__sync()
  File "/usr/share/offlineimap3/offlineimap/accounts.py", line 374, in __sync
    remoterepos.getfolders()
  File "/usr/share/offlineimap3/offlineimap/repository/IMAP.py", line
681, in getfolders
    imapobj = self.imapserver.acquireconnection()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/offlineimap3/offlineimap/imapserver.py", line 663,
in acquireconnection
    raise OfflineImapError(reason, severity, exc_info()[2])

因此 OfflineIMAP 适用于我的 GMail 帐户,但不能适用于我的 STCable 帐户。offlineimap --dry-run 命令的输出显示了有关 STCAble 服务器的一些信息;也许这些信息对我设置 OfflineIMAP 有帮助?我的 STCable 帐户的 OfflineIMAP 设置是什么?

任何建议都将不胜感激!

——保罗致以最诚挚的问候

相关内容