简体   繁体   English

无法连接到 IMAP SERVER (gmail)

[英]Not able to connect to a IMAP SERVER (gmail)

With the book "automate the boring stuff with python" I try to learn some programming basics.通过“用 python 自动化无聊的东西”这本书,我尝试学习一些编程基础知识。 Currently, I am learning about IMAP Servers.目前,我正在学习 IMAP 服务器。 Installing the module imapclient and pyzmail36 worked out pretty well, but the next step doesn´t.安装模块 imapclient 和 pyzmail36 效果很好,但下一步不行。

>>> import imapclient
>>> imapObj = imapclient.IMAPClient('imap.gmail.com',ssl=True) 

The book tells me, to go on like this, bug a huge Error occurs if I do so.这本书告诉我,像这样在 go 上,如果我这样做,就会出现一个巨大的错误。 I do not want to copy it all, since it includes my full name (users), but I guesss this is the main problem:我不想全部复制,因为它包括我的全名(用户),但我想这是主要问题:

  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)
>>> 

Unfortunately, I can not move on with the Chapter, without logging into the server.不幸的是,如果不登录服务器,我将无法继续阅读本章。

Thank you guys!感谢你们!

It seems to have problems with MacOS. MacOS似乎有问题。 I found a similar situation encountered here .我发现这里遇到了类似的情况。

Try the solutions mentioned in the above link.尝试上述链接中提到的解决方案。

Otherwise, Try by changing ssl to False.否则,尝试将 ssl 更改为 False。 It will make your connection insecure, I mean the data coming to you will be plain text.它会使你的连接不安全,我的意思是你收到的数据将是纯文本。 Anyway, Since you are learning it, Try both ways.无论如何,既然您正在学习它,请尝试两种方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM