I have spent 8 hours on this, and still can't get it right.
My situation:
My server is running on Linux xrm 2.6.32-5-amd64
;
In console: openssl s_client -connect ns1.example.com:995
works flawlessly, successful connection.
But when i execute this script:
a)
$res = imap_open("{ns1.example.com:993}",
"user@example.lv", "password");
Response is: Array ( [0] => [CLOSED] IMAP connection broken (server response) )
b)
$res = imap_open("{ns1.example.com:993/ssl}",
"user@example.lv", "password");
Response: Array ( [0] => Certificate failure for ns1.example.com: self signed certificate: /CN=ns1.example.com/emailAddress=ssl@ns1.example.com )
Is it connected with the fact that, this script is under drupal directory?
And it uses different php.ini
than server does?
Even though when i execute php_info()
, it says that imap and imap/ssl is enbaled.
i have tried all the imap_open()
flags, but still no luck.
I even can't connect to a standart gmail mailbox. Please get me out of here.