Skip to content

Commit ccdbdc7

Browse files
keszybzgitster
authored andcommitted
send-email: auth plain/login fix
git send-email was not authenticating properly when communicating over TLS with a server supporting only AUTH PLAIN and AUTH LOGIN. This is e.g. the standard server setup under debian with exim4 and probably everywhere where system accounts are used. The problem (only?) exists when libauthen-sasl-cyrus-perl (Authen::SASL::Cyrus) is installed. Importing Authen::SASL::Perl makes Authen::SASL use the perl implementation which works better. The solution is based on this forum thread: http://www.perlmonks.org/?node_id=904354. This patch is tested by sending it. Without this fix, the interaction with the server failed like this: $ git send-email --smtp-encryption=tls --smtp-server=... --smtp-debug=1 change1.patch ... Net::SMTP::SSL=GLOB(0x238f668)<<< 250-AUTH LOGIN PLAIN Password: Net::SMTP::SSL=GLOB(0x238f668)>>> AUTH Net::SMTP::SSL=GLOB(0x238f668)<<< 501 5.5.2 AUTH mechanism must be specified 5.5.2 AUTH mechanism must be specified Signed-off-by: Zbigniew Jędrzejewski-Szmek <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7ed863a commit ccdbdc7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

git-send-email.perl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,12 @@ sub send_message {
10951095
}
10961096

10971097
if (defined $smtp_authuser) {
1098+
# Workaround AUTH PLAIN/LOGIN interaction defect
1099+
# with Authen::SASL::Cyrus
1100+
eval {
1101+
require Authen::SASL;
1102+
Authen::SASL->import(qw(Perl));
1103+
};
10981104

10991105
if (!defined $smtp_authpass) {
11001106

0 commit comments

Comments
 (0)