HomeSponsorTesting SMTP Server from the Command Line in Online Tools and via...

Testing SMTP Server from the Command Line in Online Tools and via Telnet

-

Key Takeaways
  • SMTP is a network protocol for email transmission in TCP/IP networks, with the SMTP server acting as the mailman.
  • Testing via telnet into an SMTP server allows assessing server operability, detecting firewalls, and checking supported commands.
  • Online tools like Wormly, MX Toolbox, Test SMTP, Check SMTP, and SMTPer offer various functionalities for testing SMTP servers securely and comprehensively.

Before you begin reading the article, letโ€™s start with defining what SMTP is and what you can test with it.

SMTP (or Simple Mail Transfer Protocol) is a network protocol, designed for e-mail transmission in TCP/IP networks. The SMTP server is a mailman of the Internet. Basically, it helps emails get to the right destination. SMPT executes processes similar to the mechanism of delivering the actual mail. After you send an email, it gets to this server, which then delivers messages directly to their receivers.

By telneting into a given SMPT server, you can test a lot of things, for instance:

The operability of the server

Presence of a firewall that blocks communication

The list of SMTP commands that the mail server supports

Besides, you can also define the amount of time needed for a server to response, and check if the server responds with the right hostname.

Testing with a manual telnet session

Before starting testing smtp, a telnet client needs to be verified for the installation on the server. Then, begin searching a mail server to log in to. You are going to need the DNS MX record for your domain to proceed it. Use this command:

Windows:

nslookup -type=mx mailtrap.io

Linux:

nslookup -type=mx mailtrap.io
Non-authoritative answer:
Server:		192.168.0.1
Address:	192.168.0.1#53

Non-authoritative answer:
mailtrap.io	mail exchanger = 10 aspmx2.googlemail.com.
mailtrap.io	mail exchanger = 10 aspmx3.googlemail.com.
mailtrap.io	mail exchanger = 1 aspmx.l.google.com.
mailtrap.io	mail exchanger = 5 alt1.aspmx.l.google.com.
mailtrap.io	mail exchanger = 5 alt2.aspmx.l.google.com.

You need the DNS PTR for the IP you will be using. Thatโ€™s why you should start with checking your current IP address. There are plenty of websites that can help you with this.

Then run the following command, replacing T.T.T.T with your IP address.

Windows:

nslookup -type=ptr T.T.T.T

Linux:

nslookup -type=ptr A.B.C.D

Server:		192.168.0.1
Address:	192.168.0.1#53

Non-authoritative answer:
212.235.118.46.in-addr.arpa	name = SOL-FTTB.212.235.118.46.sovam.net.ua.

At this point, you have two basic requirements โ€“ the PTR for the IP you are going to use and the MX record for railsware.com. Now you can log in to the SMTP server by using this command:

telnet mail.railsware.com 25

You will see something like this code:

Trying 45.55.56.249...
Connected to mail.railsware.com (45.55.56.249).
Escape character is '^]'.
220 mail.railsware.com (PowerMTA(TM) v4.0) ESMTP service ready
The first command to issue to the mail server is going to be EHLO or HELO, which 
EHLO server.example.com

Something like this should be returned:

250-mail.railsware.com says hello
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250-8BITMIME
250-XACK
250-XMRG
250-SIZE 54525952
250-VERP
250 DSN

The MAIL FROM command will be the next to issue. It shows the address where bounces are delivered.

MAIL FROM: <test@railsware.com>
250 2.1.0 MAIL ok

The MAIL FROM command was sent, now you can send the RCPT TO command. It determines the user to send the message.

RCPT TO: <test@railsware.com>
250 2.1.5 <test@railsware.com> ok
Before starting the body of the message, you should run the DATA command.
354 send message

There are mail servers, including mail.rsilsware.com, that support PIPELINING. This means that before responding to other commands after the EHLO command, the SMTP mail server will wait until the issuing of the DATA command. In this case, you should enter the MAIL FROM, RCPT TO, and DATA commands before waiting for a response.

The list of online services for testing SMTP servers

Before starting, you have to define the SMTP serverโ€™s address. To do it, use ns lookup command or some of the online services.

The SMTP check service will include the following stages: checking your server DNS Black List status, relaying configurations, verifying MX records, verifying the email address, PTR Record.

These online services will help you examine the SMTP server:

Wormly

Wormly has a free trial to check SMTP servers, but it will not allow you define the password or port, and thereโ€™s no secure connection.

MX Toolbox

Itโ€™s a free service that will test SMTP Reverse DNS Mismatch, SMTP Transaction Time, SMTP Banner Check, SMTP TLS, SMTP Valid Hostname, SMTP Connection Time, and SMTP Open Relay. But you also will not be able to define the port or enter a password.

Test SMTP

Test SMTP sends requests to SMTP servers for performing Relaying tests. It does not provide you a sufficient toolkit to examine SMTP properly.

Check SMTP

Check SMTP works for some parts of a process but a proper examination is not possible. Besides, this service doesnโ€™t provide a secure connection.

Check SMTP can verify MX records, check your server DNS Black List status, verify email address, and run some other tests.

SMTPer

SMTPer is the best solution that gives you a secure connection and authorization and allows defining the port. You also can fill out recipient and sender forms.

Mukesh Bhardwaj
Mukesh Bhardwajhttps://itechhacks.com
Editor - An aspiring Web Entrepreneur and avid Tech Geek. He loves to cover topics related to iOS, Tech News, and the latest tricks and tips floating over the Internet.

LATEST