diff options
-rw-r--r-- | Changes | 5 | ||||
-rw-r--r-- | Net/SMTP.pm | 5 |
2 files changed, 9 insertions, 1 deletions
@@ -1,5 +1,10 @@ libnet 1.28 -- TODO + * Change Net::SMTP::auth() so that it uses the SMTP AUTH mechanism(s) + specified in the Authen::SASL object if one is provided instead of a + username. If a plain text username is specified then use the first + reported SMTP AUTH method supported, as usual. [Ewen McNeill; resolves CPAN + RT#58002] * Add support for IPv6 and SSL to Net::SMTP and Net::POP3. These features are only available if the user has diff --git a/Net/SMTP.pm b/Net/SMTP.pm index 819ce8c..52b5060 100644 --- a/Net/SMTP.pm +++ b/Net/SMTP.pm @@ -165,7 +165,10 @@ sub auth { if (ref($username) and UNIVERSAL::isa($username, 'Authen::SASL')) { $sasl = $username; - $sasl->mechanism($mechanisms); + my $requested_mechanisms = $sasl->mechanism(); + if (! defined($requested_mechanisms) || $requested_mechanisms eq '') { + $sasl->mechanism($mechanisms); + } } else { die "auth(username, password)" if not length $username; |