testing mail server from WAN
Posted: Thu Mar 08, 2012 6:29 pm
I have a mail server running live on localhost, POP3/IMAP/SMTP with SSL.
I need to check occasionally whether it is on-line from the WAN side of the network.
So I wrote a PHP script that connects to port 465 and gets the welcome message,
and FTP'd it to a remote web server, and invoked it from my browser on localhost.
and it works OK.
Then I tried it with $port = 995 and 993.
And it doesn't connect - "Failed 110 Connection timed out".
The hostname is right.
I have tried replacing it with the IP address.
The port numbers are right.
The router's ports are open to WAN.
I have tried a longer timeout.
I have monitored the connections with TCPView and during the test nothing connects for 995 and 993,
though its a live server and users are connecting with email clients all the time.
What am I doing wrong ?
I need to check occasionally whether it is on-line from the WAN side of the network.
So I wrote a PHP script that connects to port 465 and gets the welcome message,
and FTP'd it to a remote web server, and invoked it from my browser on localhost.
Code: Select all
<?php
$transport = 'ssl://' ;
$host = 'mail.mydomain.com';
$port = 465;
$timeout = 5;
$server = fsockopen($transport . $host, $port, $errno, $errstring, $timeout);
if ($server) { echo fgets($server, 80); fclose($server);}
else { echo ( 'Failed ' . $errno . ' ' . $errstring ) ; }
?>Then I tried it with $port = 995 and 993.
And it doesn't connect - "Failed 110 Connection timed out".
The hostname is right.
I have tried replacing it with the IP address.
The port numbers are right.
The router's ports are open to WAN.
I have tried a longer timeout.
I have monitored the connections with TCPView and during the test nothing connects for 995 and 993,
though its a live server and users are connecting with email clients all the time.
What am I doing wrong ?