[CentOS] Sending Email Via Telnet

Tue Oct 16 18:13:03 UTC 2012
Les Mikesell <lesmikesell at gmail.com>

On Tue, Oct 16, 2012 at 12:46 PM, John Reddy <linuxpencil at hotmail.com> wrote:
>> >    netstat -pant|grep ":25"|grep LISTEN
>> > to see if any program is listening... output should look like:
>> >   tcp 0 0* LISTEN 21493/sendmail
>> >
>> > guess it'll say 'postfix' or 'master' instead of 'sendmail' on RH6.
> ]# netstat -pant|grep ":25"|grep LISTEN
> tcp        0      0   *                   LISTEN      14058/master
> tcp        0      0      *                   LISTEN      14058/master

Something is clearly going wrong.   Try 'strace -p 14058' (the process
currently listening) in one window while you telnet in another.

>> How long are you waiting for a response to appear?  Mailers do an
>> assortment of reverse-dns lookups and perhaps an ident query to the
>> source before responding.   If you firewall these with a 'drop'
>> instead of 'reject' you leave the application hanging for fairly long
>> timeout.  And some mailers have a config option for an intentional
>> delay before their first message and will drop the connection it the
>> other end sends first (snmp protocol requires the connecting host to
>> wait).    Also, you should have something showing up in
>> /var/log/mailllog about the connections.
> I can't find anything in there that corresponds to the attempt to send an email. And why would I when there is no communication from the server in my telnet session? The problem appears to be in telnet, not in postfix. Again, this is one of 3 examples of my telnet sessions from 2 emails ago:
> [root at mydomain john]# telnet 25
> Trying
> Connected to
> Escape character is '^]'.
> HELO justtesting
> MAIL FROM: testing at gmail.com
> RCPT TO: testing at gmail.com
> To: testing at gmail.com
> From: testing at gmail.com
> Subject: testing
> Date: Tu, Oct 2012 10:21:11 -0500
> Testing
> .
> Then it hangs. I never get back to a command prompt. There is never any interaction with the telnet program after the initial response. How do I trouble-shoot this?

You aren't supposed to send anything until you get a 2xx response from
the server.   But, since the connection was accepted, something must
be happening - maybe the strace will show some activity or error.
My knee-jerk reaction to any mysterious problem is SELinux - is it in
the picture?

    Les Mikesell
       lesmikesell at gmail.com