Thursday, February 2, 2017

Testing Anonymous SMTP using Telnet

You can use telnet to test anonymous SMTP, but I do it so infrequently that I always have to look up the SMTP commands.  The following is taken from: https://www.lumension.com/kb/Home/Endpoint-Security/949.aspx

PROCEDURE

To test the mail server, perform the following:
  1. Open a command prompt
  2. Run "telnet smtp-server.domain.com 25" (replace smtp-server.domain.com with your actual SMTP server.  If the SMTP port has been modified, be sure to use the correct port assignment.  By default, SMTP communicates on TCP port 25)
  3. A connection will be established on port 25 (or modified assignment) if the SMTP server is online
As an example, the Exchange Server may answer with the following output:
220 mailserver.domain.com Microsoft ESMTP MAIL Service, Version: 5.0.2195.5329 ready at Sat, 22 May 2012 08:34:14 +0200
Try the following to send an E-Mail from the command prompt (blue = your commands):   
220 mailserver.domain.com Microsoft ESMTP MAIL Service, Version: 5.0.2195.5329 ready at  Sat, 22 May 2012 09:01:29 +0200
helo myserver.domain.com 250 mailserver.domain.com Hello [10.12.150.2]
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