diff options
author | Steve Hay <steve.m.hay@googlemail.com> | 2014-06-03 09:00:16 +0100 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2014-06-03 09:00:16 +0100 |
commit | 8dedae07612e77e4a46214334e83891dd3ce388b (patch) | |
tree | 386b9ccf0ea214348272b537d3ddffbc9daaec7d | |
parent | 036e8cefc78086246412411638fd402c5d657dc2 (diff) | |
download | perl-libnet-8dedae07612e77e4a46214334e83891dd3ce388b.tar.gz |
Net::SMTP::auth() should use AUTH mechanism(s) supplied in Authen::SASL object if present
Patch by Ewen McNeill from CPAN RT#58002.
-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; |