Testing your SMTP server setup with Telnet
When you set up a new mail server you usually want to run some tests on it to see it delivers the mail like it’s supposed to. There are tools out there to do this for you but the easiest way is to use Telnet. Telnet is found on almost any new operating system, and if it’s not there you can user your package manager to get a client.
Talking to the server
Talking to SMTP servers is really quite easy and they usually reply in a decent matter. The dialog is simple and you need only a few commands to see if everything is alright, let’s get started shall we
To use telnet just enter the command telnet the server you are connecting to in my test case mail.company.com and the SMTP standard port which is 25.
After that you should see something like this
Connected to mail.company.com (192.168.90.25).
Escape character is ‘^]’.
220 mail.company.com ESMTP Sendmail 8.13.1/8.13.1; Thu, 31 Jan 2008 21:02:57 +0200
The responding smtp server should say something like the above.
As we are a decent mail server we greet our fellow mailserver with HELO and our name.
To which the counterpart should answer
As you can see SMTP servers are very civilized in their discussions. Next we need to tell the server who we are delivering mail for. So we say
And the answer should be
Now we have to tell the server who we are delivering mail to so we say:
The server checks,or doesn’t check, the recipient depending on your setup and answers
Next we start to send some text. I won’t send any subject and you shouldn’t have to send any data either but it’s good to know how this works so we just type DATA and hit enter.
354 Enter mail, end with “.” on a line by itself
As the server says we can now input the mail and end the email with a single . on a new line. So just start typing something and when your done hit enter for a new line and the dot . and enter again to end the data send.
.
250 2.0.0 m0VJ2vCO016000 Message accepted for delivery
Last but not least end the session in a nice way by typing quit
221 2.0.0 mail.company.com closing connection
That’s it. The mail should now be delivered to you mailbox if everything was configured correctly.
No related posts.

