in reply to Net::SMTPS => auth no longer works - Migration from Debian to Docker container
From the OP:
my $smtp = Net::SMTPS->new( $server, Port => $server_port, Debug => 1, + doSSL => +$mail_sasl_type) || die "cannot connect to server ${server}"; my $sasl = Authen::SASL->new( mechanism => 'PLAIN', debug => 1, callba +ck => {pas +s => $pass, user => $user}); $smtp->auth( $sasl ) || die "cannot do mail auth";
From the output you posted I see the die statement is where it fails at $smtp->auth( $sasl ) || die [...]. Looking at the auth() method I found the documentation points out a difference in Net::SMTPS and Net::SMTP. You might try to specify the AUTHMETHOD as shown at Net::SMTPS.
METHODS Most of all methods of Net::SMTP are inherited as is, except auth(). auth ( USERNAME, PASSWORD [, AUTHMETHOD]) Attempt SASL authentication through Authen::SASL module. AUTHMETHOD is + your required method of authentication, like 'CRAM-MD5', 'LOGIN', .. +. etc. If your selection does not match the server-offerred AUTH mech +anism, authentication negotiation may fail.
Also, the synopsis for Authen::SASL shows mechanism specified as a list of the choices. You only provide PLAIN but it might be looking for one of the other options shown in your debug output.
SYNOPSIS use Authen::SASL; $sasl = Authen::SASL->new( mechanism => 'CRAM-MD5 PLAIN ANONYMOUS', callback => { pass => \&fetch_password, user => $user, } );
Debug output from Net::SMTPS :
Net::SMTPS=GLOB(0x562fb253e128)<<< 250-AUTH PLAIN LOGIN CRAM-MD5 DIGES +T-MD5
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Net::SMTPS => auth no longer works - Migration from Debian to Docker container
by Anonymous Monk on Jan 07, 2020 at 14:14 UTC | |
by Lotus1 (Vicar) on Jan 07, 2020 at 15:39 UTC | |
by NERDVANA (Deacon) on Jan 08, 2020 at 14:39 UTC | |
by initB10r (Initiate) on Jan 08, 2020 at 04:21 UTC | |
Re^2: Net::SMTPS => auth no longer works - Migration from Debian to Docker container
by initB10r (Initiate) on Jan 08, 2020 at 04:34 UTC |
In Section
Seekers of Perl Wisdom