[CentOS] Sending Email Via Telnet

John Reddy linuxpencil at hotmail.com
Tue Oct 16 10:30:02 EDT 2012


I got the first example from the postfix documentation here:
http://www.postfix.org/SASL_README.html
so I tried what I originally posted:
[root at mydomain ccc]# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
EHLO
MAIL FROM: me at gmail.com
RCPT TO: me at gmail.com
DATA
testing from server
.
^]

So I go to this page and get an example of how to do this:
http://www.freebsdwiki.net/index.php/SMTP,_testing_via_Telnet
and follow the example:

[root at mydomain john]# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
HELO justtesting
MAIL FROM: testing at gmail.com
RCPT TO: testing at gmail.com
DATA
To: testing at gmail.com
From: testing at gmail.com
Subject: testing
Date: Tu, Oct 2012 10:21:11 -0500
Testing
.
QUIT


So I go to this page and get an example of how to do this:
http://www.samlogic.net/articles/smtp-commands-reference.htm
and follow the example:

[root at mydomain john]# ps wax|grep smtp
18378 ?        S      0:00 smtpd -n smtp -t inet -u -s 2
26426 ?        S      0:00 smtpd -n 587 -t inet -u -s 2
30700 pts/0    S+     0:00 grep smtp
[root at mydomain john]# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
EHLO mydomain.com
MAIL FROM: <testing at gmail.com>
RCPT TO: <testing at gmail.com>
DATA
testing
.
QUIT

As you can see, my smtp is up. However, all of these just leave the shell hanging. None of them echo back anything from telnet, as I've seen in examples, such as this echo:
ph34r# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220  ESMTP

(That last line.) I've never gotten telnet to work. I've always just worked around it, but this time I want to check everything as I go along. Please advise.
TIA,
John
 		 	   		  


More information about the CentOS mailing list