From: "Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>
To: gitster@pobox.com, joe@perches.com, git@vger.kernel.org, peff@peff.net
Subject: [PATCH v4] send-email: auth plain/login fix
Date: Thu, 29 Sep 2011 16:16:16 +0200 [thread overview]
Message-ID: <20110929141616.GU10763@in.waw.pl> (raw)
In-Reply-To: <7v62kcz5rr.fsf@alter.siamese.dyndns.org>
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 <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
v2: - the import is performed only if it will be used
v3: - the import is performed only if it will be used, and failure is ignored
v4: - improved commit message
git-send-email.perl | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 37dfbe7..dbc435a 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1098,6 +1098,10 @@ X-Mailer: git-send-email $gitversion
}
if (defined $smtp_authuser) {
+ eval {
+ require Authen::SASL;
+ Authen::SASL->import(qw(Perl));
+ };
if (!defined $smtp_authpass) {
--
1.7.6
next prev parent reply other threads:[~2011-09-29 14:16 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-06 0:40 [PATCH] git-send-email: Add AUTH LOGIN support Joe Perches
2011-08-06 4:54 ` Junio C Hamano
2011-08-06 5:21 ` Joe Perches
2011-08-19 1:16 ` Joe Perches
2011-08-19 23:09 ` Junio C Hamano
2011-08-19 23:24 ` Joe Perches
2011-08-20 1:01 ` Junio C Hamano
2011-09-24 15:49 ` [PATCH] send-email: auth plain/login fix Zbigniew Jędrzejewski-Szmek
2011-09-26 16:38 ` Junio C Hamano
2011-09-26 16:59 ` Joe Perches
2011-09-26 17:24 ` Jakub Narebski
2011-09-27 21:36 ` [PATCH v2] " Zbigniew Jędrzejewski-Szmek
2011-09-27 21:48 ` Jeff King
2011-09-28 10:26 ` [PATCH v3] " Zbigniew Jędrzejewski-Szmek
2011-09-28 22:00 ` Junio C Hamano
2011-09-29 14:16 ` Zbigniew Jędrzejewski-Szmek [this message]
2011-09-29 15:01 ` [PATCH v4] " Joe Perches
2011-09-29 17:02 ` [PATCH] " Zbigniew Jędrzejewski-Szmek
2011-09-29 18:12 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110929141616.GU10763@in.waw.pl \
--to=zbyszek@in.waw.pl \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=joe@perches.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).