To make sure you understand all the details of what we are about to discuss, let’s define what SMTP is and what can be tested with it.
SMTP (Simple Mail Transfer Protocol) is the methodology behind the email workflow on the Internet. People have probably been wondering how emails get to their destination. SMTP fully covers it, implementing something similar to the mechanism of delivering an actual letter in an envelope. The SMTP server, or just a computer running SMTP, stands for a mail carrier of the Internet. The messages are sent directly to this server, which consequently delivers mails to their receivers. Quite convenient, isn’t it?
Various things can be tested with simply telneting into a given SMTP server:
- Is the server working?
- Is it a firewall that blocks communication?
- Does the mail server allow for relaying of a particular domain or an email address?
- What SMTP commands does the mail server support?
- How much time does it take for a server to response?
- Does the server respond with the correct hostname?
How to test SMTP server with a manual telnet session?
First, a telnet client has to be verified for the installation on the server. Then, you should search for a mail server to log in to. We will need the DNS MX record for a given domain to proceed with it. You can use something similar to the following command:
nslookup -type=mx mailtrap.io
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.
For the IP we are going to use, we need the DNS PTR. For this, we should start with the IP address the Internet sees us as having. Sites like this http://whatismyipaddress.com/ can be a perfect solution in this case.
Once you figured out your IP address, run the following command, with T.T.T.T standing for the IP address.
nslookup -type=ptr T.T.T.T
nslookup -type=ptr A.B.C.D Server: 192.168.0.1 Address: 192.168.0.1#53 Non-authoritative answer: 126.96.36.199.in-addr.arpa name = SOL-FTTB.188.8.131.52.sovam.net.ua.
We now have two basic requirements – the MX record for railsware.com and the PTR for the IP we will use. At this point, you can log in to the SMTP server. Use the following command to do it:
telnet mail.railsware.com 25
It will display something similar to the following code:
Trying 184.108.40.206... Connected to mail.railsware.com (220.127.116.11). 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 is a basic greeting that initiates the communication between the SMTP server and the telnet client. EHLO server.example.com
Something similar to the following 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 is going to be the next to issue. This command defines the address to which bounces are delivered. The “From” header is not the similar thing (the email address shown in an email client).
MAIL FROM: <email@example.com> 250 2.1.0 MAIL ok
We can send the RCPT TO command now that we the MAIL FROM command was sent. RCPT TO command determines to whom the message should be sent. This is both similar to and different than the “TO” header.
RCPT TO: <firstname.lastname@example.org> 250 2.1.5 <email@example.com> ok Before starting the body of the message, you should run the DATA command. This command “explains” that all the other content, aside from previous, is the body of the message, including the headers. DATA 354 send message
Some of the mail servers, including mail.rsilsware.com, support PIPELINING. It means that the SMTP mail server will wait until the DATA command is issued before responding to any other commands after the EHLO command. Enter the MAIL FROM, RCPT TO, and DATA commands before waiting for a response in this case.
Online services for testing SMTP servers
For the beginning, you need to define the address of a SMTP server. You can use ns lookup command to do it or us some of the online services as https://mxtoolbox.com/SuperTool.aspx?action=mx#.
The SMTP check service will include several stages as following: checking your server DNS Black List status, verifying MX Records, relaying configurations, PTR Record, verifying the email address. We have got some online services that can help you examine the SMTP server:
MX Toolbox is a free service that will perform simple tests of:
- SMTP Reverse DNS Mismatch
- SMTP Valid Hostname
- SMTP Banner Check
- SMTP TLS
- SMTP Connection Time
- SMTP Open Relay
- SMTP Transaction Time
However, you are not allowed to define the port, enter password etc. The number of tests is also limited.
Wormly gives you a free trial to check your SMTP servers, but does not allow defining the port or password, a secure connection is also not available.
SMTPer is indeed the most convenient solution that allows defining the port, provides users with a secure connection and authorization. You also can fill out both sender and recipient forms.
Test SMTP simply sends requests to SMTP servers to perform Relaying tests. This service does not have a sufficient toolkit for a proper SMTP examination.
Check SMTP works for certain parts of a process but isn’t enough for a proper examination. Does not provide a secure connection.
Check SMTP will run the following tests:
- Check your server DNS Black List status
- Verify MX Records
- Relay Configuration
- PTR Record (Reverse Lookup)
- Verify Email Address
Need help with email sending set up for your infrastructure? Find your guide here:
- Sending Emails with PHP
- Sending Emails with PHPMailer
- Sending Emails with Laravel
- Sending Emails with Symfony
- Sending Emails with NodeJS
- Sending Emails with Nodemailer
- Sending Emails with Java
- Sending Emails with Python
- Sending Emails with Django
- Sending Emails with Go
- Sending Emails with Ruby
- Sending Emails with ASP .Net C#
- Sending Emails from Angular App
- Sending Emails from React App
- Sending Emails from React Native App