in reply to Socket output issue...

I tried this and it doesn't change a thing, I run into the same problem... Argh!
#!/usr/bin/perl -w use strict; use IO::Socket; my ($host, $port, $handle, $byte); unless (@ARGV == 2) { die "usage: $0 host port" } ($host, $port) = @ARGV; $handle = IO::Socket::INET->new(Proto => "tcp", PeerAddr => $host, PeerPort => $port); unless ($handle) { die "cannot connect to mail server on $host" } $handle->autoflush(1); print "[Connected to $host:$port]\n"; print $handle "ETRN mydomain.com\nQUIT\n"; while ( <$handle> ) { print } close $handle;

Replies are listed 'Best First'.
Re: Answer: Socket output issue...
by zentara (Cardinal) on Sep 04, 2002 at 16:18 UTC
     I just jumped in on this thread, but I ran the above code
    on my localhost, and it connects. So you have sendmail going
    on port 25, and is that the port you are trying to connect to?
    
    Output:
    zentara@zentara:~/perlplay > ./z9b localhost 25
    Connected to localhost:25
    220 zentara.zentara.net ESMTP Sendmail 8.11.3/8.11.3/SuSE 
    Linux 8.11.1-0.5; Wed, 4 Sep 2002 12:20:34 -0400
    250 2.0.0 Queuing for node mydomain.com started
    221 2.0.0 zentara.zentara.net closing connection