user3001228
user3001228

Reputation: 343

Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel [perl]

im trying to send email via perl trough yahoo smtp server , and my code run on linux with no error but when i run this code on windows server 2008 r2 perl sys :

Net::SMTP>>> Net::SMTP(3.07)

Net::SMTP>>> Net::Cmd(3.07)

Net::SMTP>>> Exporter(5.72)

Net::SMTP>>> IO::Socket::IP(0.37)

Net::SMTP>>> IO::Socket(1.38)

Net::SMTP>>> IO::Handle(1.35)

Net::SMTP=GLOB(0x2b41c30)<<< 220 smtp.mail.yahoo.com ESMTP ready

Net::SMTP=GLOB(0x2b41c30)>>> EHLO smtp.mail.yahoo.com

Net::SMTP=GLOB(0x2b41c30)<<< 250-smtp.mail.yahoo.com

Net::SMTP=GLOB(0x2b41c30)<<< 250-PIPELINING

Net::SMTP=GLOB(0x2b41c30)<<< 250-SIZE 41697280

Net::SMTP=GLOB(0x2b41c30)<<< 250-8 BITMIME

Net::SMTP=GLOB(0x2b41c30)<<< 250 STARTTLS

Net::SMTP=GLOB(0x2b41c30)>>> STARTTLS

Net::SMTP=GLOB(0x2b41c30)<<< 220 2.0.0 Start TLS

Net::SMTP=GLOB(0x2b41c30)>>> RCPT TO:

Net::SMTP: Net::Cmd::getline(): unexpected EOF on command channel: Bad file descriptor at test.pl line 16.

Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at test.pl line 17.

my code is:

use Net::SMTP 3.03;

my $mailer = Net::SMTP->new(
    'smtp.mail.yahoo.com',
    Hello   =>      'smtp.mail.yahoo.com',
    Port    =>      587,
    Debug => 1,
);

$mailer->starttls();
$mailer->auth('test','123');
    #!$mailer->mail('[email protected]');
    $mailer->to('[email protected]');
    $mailer->data();
    $mailer->datasend('From: [email protected] \r\n');
    $mailer->datasend('To: [email protected] \r\n');
    $mailer->datasend('Subject: testing \r\n');
    $mailer->datasend('Content-type: text/html \r\n\n');
    $mailer->datasend('\n');
    $mailer->datasend('test test test\r\n');
    $mailer->dataend();
$mailer->quit;

what is the problem ?

result with "perl -MIO::Socket::SSL=debug4 test.pl"

Net::SMTP>>> Net::SMTP(3.07)

Net::SMTP>>> Net::Cmd(3.07)

Net::SMTP>>> Exporter(5.72)

Net::SMTP>>> IO::Socket::IP(0.37)

Net::SMTP>>> IO::Socket(1.38)

Net::SMTP>>> IO::Handle(1.35)

Net::SMTP=GLOB(0x2dade80)<<< 220 smtp.mail.yahoo.com ESMTP ready

Net::SMTP=GLOB(0x2dade80)>>> EHLO smtp.mail.yahoo.com

Net::SMTP=GLOB(0x2dade80)<<< 250-smtp.mail.yahoo.com

Net::SMTP=GLOB(0x2dade80)<<< 250-PIPELINING

Net::SMTP=GLOB(0x2dade80)<<< 250-SIZE 41697280

Net::SMTP=GLOB(0x2dade80)<<< 250-8 BITMIME

Net::SMTP=GLOB(0x2dade80)<<< 250 STARTTLS

Net::SMTP=GLOB(0x2dade80)>>> STARTTLS

Net::SMTP=GLOB(0x2dade80)<<< 220 2.0.0 Start TLS

DEBUG: .../IO/Socket/SSL.pm:568: global error: SSL Version SSLv2 not supported

Net::SMTP=GLOB(0x2dade80)>>> MAIL FROM:

Net::SMTP: Net::Cmd::getline(): unexpected EOF on command channel: Bad file descriptor at test.pl line 15.

Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at test.pl line 16.

Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at test.pl line 16.

Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at test.pl line 17.

Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at test.pl line 17.

Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at test.pl line 18.

Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at test.pl line 19.

Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at test.pl line 20.

Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at test.pl line 21.

Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at test.pl line 22.

Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file dscriptor at test.pl line 23.

Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at test.pl line 24.

Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at test.pl line 25.

Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file d

Upvotes: 2

Views: 2686

Answers (1)

Armali
Armali

Reputation: 19395

"...SSL Version SSLv2 not supported" - I have the feeling that your version of IO::Socket::SSL is not the original one but probably one which received (wrong) patches to work around problems with the broken Net::SMTP::TLS. Please make sure that you have installed an unchanged and current version of IO::Socket::SSL. – Steffen Ullrich

Upvotes: 1

Related Questions