我在使用Azure管道访问imap.gmail.com时遇到问题

时间:2020-09-28 17:19:01

标签: gmail-imap multi-factor-authentication azure-devops-pipelines

在自动化脚本的硒中,我必须从外部测试用户( something@gmail.com )检索MFA代码。我正在使用此代码与IMAP gmail传入服务器通信 using (ImapClient client = new ImapClient(GmailHostName, 993, email, ClientEmailPassword, AuthMethod.Login, true)) 当我在本地运行此测试时,它可以成功从Gmail帐户获取MFA代码。但是在 Azure Devops Pipeline 中,同一测试无法检索代码。这是来自Azure的错误: System.Net.Sockets.SocketException : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 108.177.122.109:993

   at S22.Imap.ImapClient.Connect(String hostname, Int32 port, Boolean ssl, RemoteCertificateValidationCallback validate)```
   at S22.Imap.ImapClient..ctor(String hostname, Int32 port, String username, String password, AuthMethod method, Boolean ssl, RemoteCertificateValidationCallback validate)

Has anyone faced an issue like this? Any and all help will be highly appreciated.

0 个答案:

没有答案