When starting to troubleshoot smtp issues you can do this easily via telnet, below a hosrt description on how to perform the test:

First we will make connection to the mailserver on port 25.

telnet mail.company.com 25

You will receive the following answer when, for example, you connect to an Exchange server

220 mail.company.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at  Sun, 5 Apr 2009 21:36:57 +0200

You will need to reply with a helo followed by the domain you are sending from

helo test.nl

Next you will need to specify the sender of the mail

mail from: test@test.nl

When the sender has been accepted the mailserver will respond with a 250 – OK

250 2.1.0 OK – Mail FROM test@test.nl

Next thing you need to specify is the recipient of the mail

rcpt to: user@company.com

When the recipient address has been excepted the mailserver again will respond with a 250 OK

250 2.1.5 OK recipient user@company.com

Now we have specified both the sender and recipient we can specify the mail, this will be done via the command data

data

When you have send the aboe command to the mailserver it will respond with the following command

354 Send data. End with CRLF.CRLF

The mailserver will tell you that you will need to end the mail with a .

First we specify the subject of the mail, when you don’t do this the subject will be empty.

subject: smtp test via telnet

After the subject command has been specified you will need to press enter 2 times, you won’t receive feedback of this. The 2 times enter is needed according to  RFC-822 and RFC-2822.

Now we have specified the subject we can specify the text we would like to be in the mail

_This mail is send via telnet

_ .

As mentioned earlier we end the mail with a ., the . needs to be placed on a new line. When the mail has been accepted by the mailserver for delivery it will respond with the following command

250 2.6.0 COMPANY5Kns1ZEqUz00000001@company.com Queued mail for delivery

To disconnect from the mailserver you will need to use the command quit

Quit

For further information of the RFC’s have a look at the sites below.

RFC-822

RFC-2822


Comments


Johan Veldhuis