I have libnet 3.11 which is the current latest version. I have an SMTP server which requires TLS and LOGIN auth. I can manually get all this to work fine with openssl s_client and manual commands up to the STARTTLS and then the AUTH LOGIN without problems. With perl Net::SMTP_auth, the AUTH LOGIN immediately closes the connection with a 421 error without returning prompts for the base 64 username/password. I cannot work out why. Something in the environment changed as this was working until recently, I suspect some SMTP server change. The TLS part is fine and the server enforces this before auth. I am using Net::SMTP_auth instead of Net::SMTP as the server does not advertise AUTH mechanisms which makes Net::SMTP fail to do authentication as it thinks the server can't do it.
Manual:
openssl s_client -starttls smtp -crlf -connect smtpserver:25
.
.
.
250 OK
AUTH LOGIN
.
.
.
334 VXNlcm5hbWU6
This is all fine and working as expected - code 334 is the username prompt. However, with:
my $smtp = Net::SMTP_auth->new('smtpserver');
$smtp->starttls;
$smtp->auth('LOGIN', 'username', 'password);
This dies with an SMTP 421 code "Connection closed" in the ->auth method. Debugging with Net::Cmd shows that this dies before it gets a username prompt and occurs immediately after sending "AUTH LOGIN".