about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2002-07-15 23:19:47 +0000
committerGraham Barr <gbarr@pobox.com>2002-07-15 23:19:47 +0000
commit5ee520b4c67ac7092729ae3e7d69f7c166ddf6a7 (patch)
treef5739ab46c3a7218973065a67618a594f05f7179
parent8b917ea833dbe6c4a1b5575db515f4f454818811 (diff)
downloadperl-libnet-5ee520b4c67ac7092729ae3e7d69f7c166ddf6a7.tar.gz
Net::SMTP
- Avoid extra spaces on the end of the AUTH command

-rw-r--r--Net/SMTP.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/Net/SMTP.pm b/Net/SMTP.pm
index 4da0d78..613d1db 100644
--- a/Net/SMTP.pm
+++ b/Net/SMTP.pm
@@ -16,7 +16,7 @@ use IO::Socket;
 use Net::Cmd;
 use Net::Config;
 
-$VERSION = "2.24"; # $Id: //depot/libnet/Net/SMTP.pm#25 $
+$VERSION = "2.25"; # $Id: //depot/libnet/Net/SMTP.pm#26 $
 
 @ISA = qw(Net::Cmd IO::Socket::INET);
 
@@ -126,9 +126,12 @@ sub auth {
     # todo that we would really need to change the ISA hierarchy
     # so we dont inherit from IO::Socket, but instead hold it in an attribute
 
-    my @cmd = ("AUTH", $client->mechanism, MIME::Base64::encode_base64($str,''));
+    my @cmd = ("AUTH", $client->mechanism);
     my $code;
 
+    push @cmd, MIME::Base64::encode_base64($str,'')
+      if defined $str and length $str;
+
     while (($code = $self->command(@cmd)->response()) == CMD_MORE) {
       @cmd = (MIME::Base64::encode_base64(
         $client->client_step(
@@ -670,6 +673,6 @@ it under the same terms as Perl itself.
 
 =for html <hr>
 
-I<$Id: //depot/libnet/Net/SMTP.pm#25 $>
+I<$Id: //depot/libnet/Net/SMTP.pm#26 $>
 
 =cut