about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2004-06-29 15:39:46 +0000
committerGraham Barr <gbarr@pobox.com>2009-02-24 08:51:38 -0600
commite17d933dae162eb2ce11b5f6787c21bc360c88e5 (patch)
tree1f89ddfd798a94b7f30f8e478ce7ada4d6133751
parentb6bed8c2160621f180f5c58db9cfccfc26a6a565 (diff)
downloadperl-libnet-e17d933dae162eb2ce11b5f6787c21bc360c88e5.tar.gz
Fixed Authen::SASL checking in SMTP.pm and POP3.pm
-rw-r--r--Net/POP3.pm4
-rw-r--r--Net/SMTP.pm8
2 files changed, 7 insertions, 5 deletions
diff --git a/Net/POP3.pm b/Net/POP3.pm
index 3a5aec0..a04e12a 100644
--- a/Net/POP3.pm
+++ b/Net/POP3.pm
@@ -13,7 +13,7 @@ use Net::Cmd;
 use Carp;
 use Net::Config;
 
-$VERSION = "2.27";
+$VERSION = "2.28";
 
 @ISA = qw(Net::Cmd IO::Socket::INET);
 
@@ -401,7 +401,7 @@ sub auth {
     eval {
         require MIME::Base64;
         require Authen::SASL;
-    } or return $self->set_error(500,["Need MIME::Base64 and Authen::SASL todo auth"]);
+    } or $self->set_status(500,["Need MIME::Base64 and Authen::SASL todo auth"]), return 0;
 
     my $capa = $self->capa;
     my $mechanisms = $capa->{SASL} || 'CRAM-MD5';
diff --git a/Net/SMTP.pm b/Net/SMTP.pm
index e7276de..44a955a 100644
--- a/Net/SMTP.pm
+++ b/Net/SMTP.pm
@@ -16,7 +16,7 @@ use IO::Socket;
 use Net::Cmd;
 use Net::Config;
 
-$VERSION = "2.28";
+$VERSION = "2.29";
 
 @ISA = qw(Net::Cmd IO::Socket::INET);
 
@@ -109,8 +109,10 @@ sub etrn {
 sub auth {
     my ($self, $username, $password) = @_;
 
-    require MIME::Base64;
-    require Authen::SASL;
+    eval {
+        require MIME::Base64;
+        require Authen::SASL;
+    } or $self->set_status(500,["Need MIME::Base64 and Authen::SASL todo auth"]), return 0;
 
     my $mechanisms = $self->supports('AUTH',500,["Command unknown: 'AUTH'"]);
     return unless defined $mechanisms;