I am having a problem connecting php code to an IMAP server.
So as it goes I have a VPS with Godaddy and I also have a shared hosting account that has the email address I want to connect to. I also have a local virtual machine running CentOS 6 with LAMP.
If I run my code on the Godaddy VPS, the imap connection works perfectly to the mailbox. As soon as I put the code on the local virtual machine it simply won't connect to the mail server:
Warning: imap_open(): Couldn't open stream {mailserverdomain.co.uk:143/imap/notls}INBOX in /var/www/html/getemail.php on line 25 Notice: Unknown: Can't connect to mailserverdomain.co.uk,143: Permission denied (errflg=2) in Unknown on line 0
It is using exactly the same code, and exactly the same connection info that I use on the Godaddy VPS copy. So I don't understand why my local virtual machine won't connect to the mail server. I have iptables completely switched off on the local virtual machine.
I'm getting "permission denied", even though it works fine on the Godaddy VPS. Obviously i have php imap installed on my local vm because the functions work...they just fail to connect to the external mail server.
I get this error from imap_open
Notice: Unknown: SECURITY PROBLEM: insecure server advertised AUTH=PLAIN
I don't get this running it from the Godaddy VPS, only from my internal virtual machine. It makes no sense!
And here is the php connection code which works fine on the VPS but not my VM:
imap_open("{" . $emailServer . ":" . $emailPort . "/imap/notls}INBOX",$emailUser,$emailPass)