How to use Telnet command to test your Email Server connectivity

Telnet is a network protocol used on the Internet or local area networks which allows a client to talk to a server remotely. Telnet is a very useful tools for System Admin to do the email troubleshooting.

Here i going to show some basic steps to send an email from your server and how to check your email using telnet.

A) How to send email using telnet

1. Launch your command prompt or terminal.

2. Telnet mail server over port 25 (SMTP).

munkwais-MacBook:~ munkwai$ telnet mail.mydomain.com 25
Trying 192.168.200.191…
Connected to mail.mydomain.com.
Escape character is ‘^]’.
220 mail.aims.com.my ESMTP Postfix

If the mailhost is available you should get a response similar to “220 mydomain.com” followed by some text that identifies the email server software. It is also possible that you get a simpler response designed not to give away any information to potential hackers. If you telnet to my company’s external mail servers you’ll simply get “220 SMTP Relay”.

3. Now, let’s start talking to the server.  Type helo mail.mydomain.com. The receiving server should respond with “250 mail.mydomain.com

helo mail.mydomain.com
250 mail.mydomain.com

4.  Now you have to give the sender email address. Eg, you want to send message from your domain.

mail from: testing@mydomain.com

You should see a response similar to “250 Sender OK”. If you get a rejection it will hopefully give you some additional information to identify why

5. Now you have to enter the recipient email address.

rcpt to: techkaki@gmail.com

You should get a response like “250 desination-email-address OK”

6. To start write the message – type data and press enter

data

The server should respond with something like “354 Start mail input; end with .”

7. If you want a subject for your email type Subject:-type subject here- and then press enter twice. After that, you can continue type the body text. When you are finished, just start a new line and enter a full stop then enter.  You’ll see something like “250 message queued for delivery”.

Subject: Testing email from techkaki

Hi there

This is testing email from techkaki using telnet.

Thank you.

techkaki.com

.
250 2.0.0 Ok: queued as ACFF938D0077

8. To exit the telnet, you can just issue the quit command

B) Use telnet testing incoming mail (POP3) settings

1. Launch your command prompt or terminal.

2. Telnet mail server over port 110 (POP3).

techkakis-Computer:~ munkwai$ telnet mail.mydomain.com 110
Trying 192.168.200.191…
Connected to mail.mydomain.com.
Escape character is ‘^]’.
+OK mail.mydomai.com Zimbra POP3 server ready

The server will return the message ‘+OK‘ indicating the server received you command and allow you to proceed to the next command.

3. Now, enter your username for the pop3 e-mail account using the “user” command follow by a valid username or valid email address

user techkaki
+OK hello techkaki, please enter your password

OR

user techkaki@mydomain.com
+OK hello techkaki@mydomain.com, please enter your password

Note: If the mailbox exists the server reply should be: +OK Password required.

4. The server ready to receive the password, you just enter your email password

pass youremailpassword

If the password that you enter is accepted the server, the server should be reply : +OK logged in.

If the password that you enter is not correct or the mailbox not exist, the server should be reply: –ERR login failed

5. Once you successful login, if you wish to see the list of email on your mailbox, just enter the list command

list
+OK 802 messages
1 20667
2 21174
3 45762
4 31804
5 46282
6 21371
7 22089
8 25015
….

6. If you wish to read one of the email. Eg: email no 8. You can type the following command

retr 8

After that, content of the email will be show on the terminal or command prompt

7. Once you done, just enter quit command to exit

Leave a Reply

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