> I've a question about AUTH LOGIN
> If for example, you write:
> AUTH LOGIN bXl0ZXN0dXNlcg== (encode_base64(mytestuser))
> shouldn't qpsmtpd reply with something like:
> UGFzc3dvcmQ6 (encode_base64(Password:))
> and wait for the password?
Interesting. I fixed this in my own version long ago, but apparently
forgot to report back my fix. Sorry. The problem here is that auth
login was never properly specified and is implemented in different
ways in different clients. I know of at least three methods.
1. Client sends three lines:
AUTH LOGIN
Username
Passowrd
2. Client sends two lines:
AUTH LOGIN Username
Password
3. Client sends one line:
AUTH LOGIN Passhash\0Username\0Password
The second method is very unusual and currently not implemented in
qpsmtpd as released. I've found no documentation whatsoever about
this variant and only learned it when a customer run into problems
and i debugged the problem by sniffing the line traffic. Iirc the
customer uses "Vivian Mail".
Here is the modified code i'm using:
elsif ($mechanism eq "login") {
if ( $prekey ) {
if ( $prekey =~ /\x0/ )
{
($passHash, $user, $passClear) = split /\x0/,
decode_base64($prekey);
} else
{
$user = decode_base64($prekey);
$passHash = '';
$session->respond(334, &e64("Password:"));
$passClear = <>;
$passClear = decode_base64($passClear);
if ($passClear eq '*') {
$session->respond(501, "Authentification canceled");
return DECLINED;
}
}
}
else {
$session->respond(334, &e64("Username:"));
$user = decode_base64(<>);
if ($user eq '*') {
$session->respond(501, "Authentification canceled");
return DECLINED;
}
$session->respond(334, &e64("Password:"));
$passClear = <>;
$passClear = decode_base64($passClear);
#warn("Debug: Pass: '$pass'");
if ($passClear eq '*') {
$session->respond(501, "Authentification canceled");
return DECLINED;
}
}
}
Regards
Michael
--
It's an insane world, but i'm proud to be a part of it. -- Bill Hicks