Testing SMTP With Telnet
I love the internet application protocols like HTTP and SMTP, because they are easily testable with telnet and simple ascii input. Like for example when I needed to test, if a postfix installation of mine was able to relay from a host I had configured it to allow from. I just logged in to the host it needed to be able to relay from, and did this:
[user@relayfromhost user]$ telnet smtphost 25
Connected to smtphost (IP here).
Escape character is '^]'.
220 smtphost ESMTP Postfix (Ubuntu)
MAIL FROM: root@relayfromhost
250 2.1.0 Ok
RCPT TO: an_email@address.com
250 2.1.5 Ok
DATA
354 End data with <cr><lf>.<cr><lf>
Hello,
This is a test email
.
250 2.0.0 Ok: queued as 58AFD4063F
QUIT
221 2.0.0 Bye
Connection closed by foreign host.
That is all. Testing done through telnet, entering ordinary ascii commands to the SMTP server. Cool!
February 18, 2008
Tags: smtp, telnet Posted in: Uncategorized

Leave a Reply