3

I have tried to connect to mit private as well to my google apps for work inbox via IMAP using the Horde_Imap_Client. 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. The Exception i got was Error when communicating with the mail server. and the imap.log only showed me this

------------------------------
>> 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

Benjamin
  • 147
  • 1
  • 9
  • Does whereever you're running this allow port 993 through? Have you tried basic connectivity tests? – Max Jan 29 '16 at 16:32
  • 1
    Yes, port 993 is open and i can connect to the office365 imap server on the same port. SMTP connections to the gmail server are working too, onyl IMAP is not working – Benjamin Jan 31 '16 at 21:02

1 Answers1

1

Change

'secure' => true,

to

'secure' => 'tlsv1',

This will force TLSv1 connections.

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.

M12
  • 737
  • 1
  • 9
  • 14