about summary refs log tree commit
diff options
context:
space:
mode:
-rw-r--r--Changes4
-rw-r--r--lib/Net/SMTP.pm2
2 files changed, 4 insertions, 2 deletions
diff --git a/Changes b/Changes
index 12f229e..82b9b4e 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,8 @@
 libnet 3.02  -- TODO
 
-  * TODO
+  * Fix $smtp->auth($sasl) to try the AUTH mechanism (if present) in the
+    Authen::SASL object before falling back on other mechanisms. [Resolves
+    CPAN RT#99415]
 
 libnet 3.01  -- Thu Oct 09 2014
 
diff --git a/lib/Net/SMTP.pm b/lib/Net/SMTP.pm
index df90227..feeb1da 100644
--- a/lib/Net/SMTP.pm
+++ b/lib/Net/SMTP.pm
@@ -193,8 +193,8 @@ sub auth {
         if $self->debug;
       $mechanisms =~ s/\b\Q$failed_mechanism\E\b//;
       last unless $mechanisms =~ /\S/;
+      $sasl->mechanism($mechanisms);
     }
-    $sasl->mechanism($mechanisms);
     
     # We should probably allow the user to pass the host, but I don't
     # currently know and SASL mechanisms that are used by smtp that need it