Subject: | Extraneous newline on AUTHENTICATE command |
encode_base64 adds a trailing newline to the base64 string. The
AUTHENTICATE command also sends its own newline, resulting in a blank
line after authentication. The attached patch fixes this.
- Alex
Subject: | newline.patch |
--- lib/IMAP/Client.pm 2007-11-26 13:20:32.000000000 -0500
+++ /usr/lib/perl5/site_perl/5.8.8/IMAP/Client.pm 2007-11-26 13:22:10.000000000 -0500
@@ -1265,7 +1265,7 @@
$self->{user} = $login;
$self->{auth} = $autheduser || $login;
$autheduser='' unless (defined $autheduser);
- my $encoded = encode_base64("$autheduser\000$login\000$passwd");
+ my $encoded = encode_base64("$autheduser\000$login\000$passwd","");
return($self->_imap_command("AUTHENTICATE","PLAIN $encoded"));
}
sub authenticate2($$$) { # Multi-line version of authentication
@@ -1274,7 +1274,7 @@
$self->{user} = $login;
$self->{auth} = $autheduser || $login;
$autheduser='' unless (defined $autheduser);
- my $encoded = encode_base64("$autheduser\000$login\000$passwd");
+ my $encoded = encode_base64("$autheduser\000$login\000$passwd","");
return($self->_imap_command("AUTHENTICATE","PLAIN","$encoded"));
}