简体   繁体   English

通过Horde_Imap_Client连接到Gmail

[英]Connecting to Gmail via Horde_Imap_Client

I have tried to connect to mit private as well to my google apps for work inbox via IMAP using the Horde_Imap_Client. 我尝试使用Horde_Imap_Client通过IMAP连接到mit私有以及我的谷歌应用程序以进行工作收件箱。 I have used the following config: 我使用了以下配置:

$config = array(
    'username' => $username,
    'password' => $password,
    'hostspec' => 'imap.gmail.com',
    'port' => '993',
    'secure' => true,
    "debug" => "imap.log",
    "debug_literal" => true
);

I also tried ssl, sslv2, sslv3 and tls for the secure value. 我还尝试了ssl,sslv2,sslv3和tls作为安全值。 The Exception i got was Error when communicating with the mail server. 我收到的例外是Error when communicating with the mail server. and the imap.log only showed me this 而imap.log只给我看了这个

------------------------------
>> Thu, 28 Jan 2016 18:29:14 +0100
>> Connection to: imap://imap.gmail.com:993/
>> Server connection took 0.0156 seconds.
>> Slow Command: 10.018 seconds
>> ERROR: read/timeout error.
------------------------------

I also tried allowing "insecure apps" in my google account but the result was the same. 我也试过在我的谷歌帐户中允许“不安全的应用程序”,但结果是一样的。 Any clues? 有线索吗? The connection works fine with our in-house IMAP server and the office365 IMAP server 该连接可与我们的内部IMAP服务器和office365 IMAP服务器一起使用

Change 更改

'secure' => true,

to

'secure' => 'tlsv1',

This will force TLSv1 connections. 这将强制TLSv1连接。

I ran into this same problem myself. 我自己遇到了同样的问题。 I posted to the Horde mailing list but was able to resolve the issue a day later on my own with the above change. 我发布到Horde邮件列表,但能够在一天之后通过上述更改自行解决问题

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

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