Running perl 5.22.0 on z/OS 2.2 RSU1605. The SMTP mail function does not complete at dataend(); appears to hang and no mail is sent.
Works correctly using perl 5.8.7 from IBM Ported Tools. Fails on perl 5.16.2 as well.
Basically using this sample program provided in the SMTP file to recreate the failure:
#!/usr/local/bin/perl -w
use Net::SMTP;
$smtp = Net::SMTP->new(‘mailhost’);
$smtp->mail($ENV{USER});
if ($smtp->to(‘postmaster’)) {
$smtp->data();
$smtp->datasend(“To: postmaster\n”);
$smtp->datasend("\n");
$smtp->datasend(“A simple test message\n”);
$smtp->dataend();
} else {
print "Error: ", $smtp->message();
}
$smtp->quit;
We change “mailhost” to our smtp mail server and “postmaster” to "xx.yyyyy@company.com" so mail comes to tester. Also the replaced #!/usr/local/bin/perl -w
to
#!/shared/RSPTz/ported/perl522/bin/perl -w
After failure reproduced, I replaced
$smtp = Net::SMTP->new(‘mailhost’);
with
$smtp = Net::SMTP->new(‘mailhost’, Debug => 1,);
This change allowed me to determine that all works until the program gets to the dataend() statement.