Daily Archives: November 27, 2013

Solve PHP imap_open Invalid Certificate Failure

Lets say, I have a following configuration:

Incoming Server: mail.domain.com
IMAP Port: 143
Username: user@domain.com
Password: userpass

But having error while trying to connect inbox, like following code:

$inbox = imap_open('{mail.domain.com:143}INBOX', 'user@domain.com', 'userpass');

ERROR:
Can't open mailbox {mail.domain.com:143}INBOX: invalid remote specification

The solution is to use a flag “/novalidate-cert”. Its purpose is “do not validate certificates from TLS/SSL server, needed if server uses self-signed certificates”.

So this will be right call:

$inbox = imap_open('{mail.domain.com:143/novalidate-cert}INBOX', 'user@domain.com', 'userpass');
Advertisements