John Peacock wrote:
>
> Premature end of base64 data at lib/Qpsmtpd/Auth.pm line 289, <> line 1.
>
> means that the $username/$passHash are not being extracted properly.
It turns out that, in order for IO::Socket::SSL to correctly translate the
inbound data, you have to explicitely say <STDIN> and not the magic input
operator <>. I've fixed it in branches/0.3x and I have attached the diff to fix
it as well.
John
=== lib/Qpsmtpd/Auth.pm
==================================================================
--- lib/Qpsmtpd/Auth.pm (revision 760)
+++ lib/Qpsmtpd/Auth.pm (local)
@@ -236,7 +236,7 @@
if ( $mechanism eq "plain" ) {
if (!$prekey) {
$session->respond( 334, "Please continue" );
- $prekey= <>;
+ $prekey= <STDIN>;
}
( $passHash, $user, $passClear ) = split /\x0/,
decode_base64($prekey);
@@ -250,7 +250,7 @@
else {
$session->respond(334, e64("Username:"));
- $user = decode_base64(<>);
+ $user = decode_base64(<STDIN>);
#warn("Debug: User: '$user'");
if ($user eq '*') {
$session->respond(501, "Authentification canceled");
@@ -258,7 +258,7 @@
}
$session->respond(334, e64("Password:"));
- $passClear = <>;
+ $passClear = <STDIN>;
$passClear = decode_base64($passClear);
#warn("Debug: Pass: '$pass'");
if ($passClear eq '*') {
@@ -277,9 +277,7 @@
# We send the ticket encoded in Base64
$session->respond( 334, encode_base64( $ticket, "" ) );
- my $line = <>;
- chop($line);
- chop($line);
+ my $line = <STDIN>;
if ( $line eq '*' ) {
$session->respond( 501, "Authentification canceled" );
@@ -287,7 +285,6 @@
}
( $user, $passHash ) = split( ' ', decode_base64($line) );
-
}
else {
$session->respond( 500, "Unrecognized authentification mechanism" );