Subject: | PLAIN Login: Order of login data not accepted by Dovecot |
I'm trying to use Mail::Box to migrate some mails from thunderbird to an
IMAP Server running Dovecot, so Mail::IMAPClient acts as Transport.
I can log in on this server with thunderbird, but not with
Mail::IMAPClient. The problem is that dovecot expects the username in
the base64 encoded login string on the second position, not on the
first. (Found by wireshark)
I've now changed the resposible code for the plain login to
elsif ( $scheme eq 'PLAIN' ) { # PLAIN SASL
$response ||= sub {
my ( $code, $client ) = @_;
encode_base64(
chr(0)
. $client->User
. chr(0)
. $client->Password,
''
);
};
}
which works against dovecot. I'm not sure whether this is a general fix
(except that $client->Proxy might be re-added on first position), but I
would interpret RFC 4616, Section 2, first paragraph that way.