IMAP unable to connect - settings? (PHP code)

The situation:
Access to MAIB from sub-client’s development PC’s running MS Win10 running XAMPP Apache and PHP7xx
IMAP is enabled and can connect to other project boxes (not MAIB) using port 143

Get an error on development browser when attempting to connect to MAIB

$imap = imap_open('{' . $server . ':' . $port . $opstring . '}INBOX', $user, $pass, null, 1);

where:
$server is ‘box.example.com
$port is 993
$opstring is ‘/imap/tls’
$user = ‘fred@example.com’
$pass = 'password for fred’s email account on MIAB

Someone suggested this is something to do with dovecot?

Are there any logs on MIAB machine I could examine for clues? I do not want to give sub-contract client admin access to MIAB machine.

In a separate (possibly unrelated issue) I have set up Moz Thunderbird as a client on another PC and it seems to work in pulling emails off MAIB but sending emails seem to be rejected. (A SMTP problem) But at least IMAP pulling records ok on that machine.

According to PHP’s docs the following should be good:

$mbox = imap_open ("{box.example.com:993/imap/ssl}INBOX", "user_id@example.com", "password");

(Notice the string, it is /imap/ssl, not tls (in this case with port 993 ssl should be fine.))

For thunderbird SMTP for clients only works on 587, do not use 465 or 25.

If you get a cert error add /novalidate-cert after /imap/ssl:

$mbox = imap_open ("{box.example.com:993/imap/ssl/novalidate-cert}INBOX", "user_id@example.com", "password");
1 Like