Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts

Telnet 25 – checking email connections

Posted by plattapuss on December 23rd, 2008

As I use this frequently to test remote mail hosts for one of my clients, I figure it deserves a spot here. This will allow you to manually test a remote mail server using telnet and port 25:

First get the mail server address for a website. We will use gmail.com for our example:

CODE:
  1. dig gmail.com mx
  2. ...
  3. gmail.com.    1654  IN    MX  50 gsmtp183.google.com.
  4. gmail.com.    1654  IN    MX  5 gmail-smtp-in.l.google.com.
  5. gmail.com.    1654  IN    MX  10 alt1.gmail-smtp-in.l.google.com.
  6. gmail.com.    1654  IN    MX  10 alt2.gmail-smtp-in.l.google.com.
  7. gmail.com.    1654  IN    MX  50 gsmtp147.google.com.
  8. ...

Not sure if there is a specific mail server to choose, but I usually choose one with a higher priority. In this case I will choose gmail-smtp-in.l.google.com to test from my server:

CODE:
  1. telnet alt2.gmail-smtp-in.l.google.com 25
  2. Trying 66.249.91.27...
  3. Connected to alt2.gmail-smtp-in.l.google.com (66.249.91.27).
  4. Escape character is '^]'.
  5. 220 mx.google.com ESMTP y37si31029380iky.4
  6. HELO outofcontrol.ca
  7. 250 mx.google.com at your service
  8. MAIL FROM:<myemailaddress@outofcontrol.ca>
  9. 250 2.1.0 OK y37si31029380iky.4
  10. RCPT TO:<mygmailaddress@gmail.com>
  11. 250 2.1.5 OK y37si31029380iky.4
  12. DATA
  13. 354  Go ahead y37si31029380iky.4
  14. This is a test.
  15. .
  16. 250 2.0.0 OK 1230083982 y37si31029380iky.4
  17. QUIT
  18. 221 2.0.0 closing connection y37si31029380iky.4
  19. Connection closed by foreign host.

A few notes:
On most email servers you do NOT need to include the < or > tags around the email address. Stricter mail servers require it. On gmail if you do not include them you get a nasty '555 5.5.2 Syntax error'.
Don't do anything nasty or stupid, as you can be easily traced through the remote servers mail log. This how-to is to help remind me and to help you trouble shot potential email issues with remote servers, or even to your own server.

Enjoy.



Reader Comments

Sorry, comments are closed.