Subject: | working with rude mail servers |
When using this module to send mail through gmail.com, I receive errors like this:
Use of uninitialized value in pattern match (m//) at
/usr/lib/perl5/site_perl/5.8.8/Net/SMTP/TLS.pm line 140, <GEN0> line 7.
Use of uninitialized value in numeric eq (==) at
/usr/lib/perl5/site_perl/5.8.8/Net/SMTP/TLS.pm line 396, <GEN0> line 7.
Use of uninitialized value in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.8.8/Net/SMTP/TLS.pm line 397, <GEN0> line 7.
Use of uninitialized value in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.8.8/Net/SMTP/TLS.pm line 397, <GEN0> line 7.
An error occurred disconnecting from the mail server:
Even though there are errors, the message is sent successfully. I watched the smtp
conversation and these errors happen immediately after the client sends the QUIT command.
Apparently gmail.com disconnects immediately instead of replying with code 221.
I fixed it for my system with the following two changes:
Line 139: add || "" to the end of the line immediately before the semicolon. So the revised
line looks like this:
my $line = $me->{sock}->getline() || "";
Line 395: add || (221,"") to the end of the line immediately before the semicolon. So the
revised line looks like this:
my ($num, $txt) = $me->_response() || (221,"");
Assuming code 221 is probably not a great idea but maybe you can make the module a little
more robust, so that if we're at QUIT and the server disconnects we don't throw an error...
maybe a warning instead ?