| Small linux deployments » Quick Summary of the SMTP protocol for telnet to port 25 | System Administration and Web Application Development Blog

It often comes up where I’ve got a mail delivery issue (user n can’t send email to domain n.com) and it’s difficult to troubleshoot just with the info in the logs. One thing that sometimes yields useful info is directly telnetting to port 25 of the offending mail server. This way if it’s rejecting messages you can see the exact reject message, or it could be violating the protocol in some creative way.

I just ran into a succinct protocol description at http://helpdesk.islandnet.com/pep/smtp.php

Here’s their transcipt of a successful SMTP session. Be sure to notice the excra line break between the end of the headers and the beginning of the body.

telnet mail.islandnet.com 25
220 Islandnet.com ESMTP server ready
helo a.b.c
250 mail.islandnet.com Hello x [YOUR_IP_ADDRESS]
mail from:
250 is syntactically correct
rcpt to:
250 verified
data
354 Enter message, ending with “.” on a line by itself
From: Bugs Bunny
To: Daffy Duck
Subject: Loony Toons!

Hi there!
.
250 OK id=1778te-0009TT-00
quit
221 mail.islandnet.com closing connection

3 Responses to “Quick Summary of the SMTP protocol for telnet to port 25”

  1. artiomix Says:

    Thank you for this, mate! Sometimes this really matters as undelivered mail is usually a headache for system administrators ;)

  2. esofthub Says:

    I couldn’t agree with you more Erek. I like the fact you executed a run and showed the output. It’s very helpful.

  3. Matt Newcombe Says:

    Hi Erek,

    Good tip. One thing to watch though is that a lot of ISPs now block outbound access to port 25 to prevent people running their own mail servers.

    A real pain when you’re trying to troubleshoot problems from home! You can end up troubleshooting the wrong problem! :-)

    Regards - Matt

Leave a Reply