Subject: | Multiline SMTP Service ready bug |
I've recently found and fixed a bug in this module when connecting to
some SMTP servers. I've documented this issue in more detail here:
http://tonyborries.com/techblog/cpanel-exim-and-perls-netsmtptls/
TL;DR: Multiline SMTP Service Ready Responses (220 status) cause the
connection to fail, as only the first line is read on connect, leaving
the additional lines in the buffer.
Below I've included my fix.
$ diff Net-SMTP-TLS-0.12/lib/Net/SMTP/TLS.pm Net-SMTP-TLS-0.12-
fixed/lib/Net/SMTP/TLS.pm
117,121c117,126
< # read the line immediately after connecting
< my ($rsp,$txt) = $me->_response();
< if(not $rsp == 220){
< croak "Could not connect to SMTP server: $host
$txt\n";
< }
---
Show quoted text
> # read the line(s) immediately after connecting
> my $rsp;
> my $txt;
> my $more;
> do {
> ($rsp,$txt,$more) = $me->_response();
> if(not $rsp == 220){
> croak "Could not connect to SMTP server: $host
$txt\n";
Show quoted text> }
> } while ($more eq '-');