Testing mail services
From Mac OS X Server FAQ
You can test mail services such as SMTP, POP3 and IMAP4 by telneting to the services well port and simulating a session. (Note: using the telnet tool in this manner to connect to a port does not require the telnet service to be running on the source machine you are testing from or on the destination machine you are trying to test.)
This is best first tried from the local server to localhost (presuming you've not disabled localhost for the service) and then from another machine on your local network, followed by a machine outside your network.
% telnet localhost smtp Trying 127.0.0.1... Connected to host.domain.top. Escape character is '^]'. 220 host.domain.top ESMTP Postfix QUIT 221 Bye Connection closed by foreign host.
In the above example we successfully connected to the SMTP server running on the well known port for SMTP (port 25), telnet informed us that it was trying to connect to that host, had successfully connect to the host on the port specified, the escape sequence used to break out of the telnet session, followed by the banner received from the SMTP service running on the server. We then typed the SMTP command QUIT to inform the SMTP service we were finished, it responded with a success code informing us it was disconnecting, and then telnet informed us the conenction was closed.
You should first confirm that you can successfully connect to the port the service is running on. If you get a successful connection and response from the server you know that it's listening and that you were able to reach that service (through any firewalls, et cetera.) If you get messages from telnet like:
Trying 192.168.1.20... telnet: connect to address 192.168.1.20: Connection refused telnet: Unable to connect to remote host
then this indicates that we weren't able to successfully conenct to the service on the server, either because the service wasn't running or their was something (like a firewall) blocking our request.
If you can successfully connect to the service you can then continue testing by sending messages approriate for the service protocol in question to further attempt to test the service manually, "on the wire", using commands specifc to each service. See the services RFC for more information on the services commands and syntax. In this way you can manually send SMTP mail messages, check POP and IMAP mailboxes, test authentication and authorization methods, and otherwise "see" exactly what is occuring at the application session level.
