Check Port 25 with the Telnet Command

You can check your SMTP Server on SMTP port 25 with the following Telnet command:

Open a command line and type

telnet smtp-server.domain.com 25

If your server is online a connection will be established on port 25 (SMTP).

An Exchange Server answers with the following output:

220- mailserver.domain.com ESMTP Exim 4.82 #2 Fri, 30 May 2014 21:24:45 -0400
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.

When you type the ‘help’ command the available commands are listed:

214-This server supports the following commands:
214 HELO EHLO STARTTLS RCPT DATA RSET MAIL QUIT HELP AUTH TURN ATRN ETRN BDAT VRFY

Try the following to send an eMail from the command line: 

220- mailserver.domain.com ESMTP Exim 4.82 #2 Fri, 30 May 2014 21:24:45 -0400
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
helo myserver.domain.com
250 mailserver.domain.com Hello [10.1.11.133]
mail from:<myname@mydomain.com>
250 2.1.0 myname@mydomain.com….Sender OK
rcpt to:<recipientname@mydomain.com>
250 2.1.5 recipientname@mydomain.com
data
354 Start mail input; end with <CRLF>.<CRLF>
subject: This is a test mail
to: recipientname@mydomain.com
This is the text of my test mail.
.
250 2.6.0 <exchange.domain.com> Queued mail for delivery
quit

If the mailserver returns a “syntax error” after the “mail from:” command, you’ve probably forgotten to put the mail address in brackets <>

This entry was posted in Linux, Mail server. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *