about summary refs log tree commit
diff options
context:
space:
mode:
-rw-r--r--Changes5
-rw-r--r--Net/SMTP.pm5
2 files changed, 9 insertions, 1 deletions
diff --git a/Changes b/Changes
index e51a43b..264d3e3 100644
--- a/Changes
+++ b/Changes
@@ -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;