Thursday, September 29, 2011

Testing an SMTP server with Telnet

So you are having issues with your email server and are wanting to test it. How can you do this without a bunch of additional software? Use the Telnet client that is built into your OS (Windows, Linux, etc.). Here are the instructions if you are using Windows.

Start a command prompt and enter this telnet command at the prompt:

telnet mx1.server.com smtp

You should get a response of some type back from the email server (assuming you can connect). It should be the default greeting for the server. If it identifies your system type, you may want to make a change to this once you are done testing. You don't want to clue in hackers to your OS and email system type should a compromise of some type becomes public for your choice of email system.

Now, let's enter some data at the prompt we have.

MAIL from: sender@source-email.com <=== This tells who the email is "from"
RCPT to: recpt@server.com <=== This is who is getting the email. You'll enter this again
DATA <=== Now, tell the server that data comes next.
From: sender@source-email.com <=== Your standard "From" for an email
To: recpt@server.com <=== Your standard "To" for an email
Subject: Test message <=== Your standard "Subject" for an email
<=== This is a blank line....don't forget it
This is a test message. <=== The "body" of your email. Type something here
. <=== A period on a line by itself will tell the SMTP server you are done entering information

You should get a message at this point in time from your server about the email that you just "sent".

QUIT <=== Tell the SMTP server that you are done.

If everything is working, you should get an email at the address that you sent it to. If not, start looking at your logs to try and figure it out.


No comments: