{"thread":{"id":"28030","subject":"[PATCH] git-send-email: Add AUTH LOGIN support","startedAt":"2011-08-06T00:40:10Z","lastAt":"2011-09-29T18:12:32Z","messageCount":19,"participants":["Joe Perches","Junio C Hamano","Zbigniew Jędrzejewski-Szmek","Jakub Narebski","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"172998","messageId":"c1be0c3bd05779897fdc92907fe65d84c88ac72b.1312591104.git.joe@perches.com","threadId":"28030","inReplyTo":null,"subject":"[PATCH] git-send-email: Add AUTH LOGIN support","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2011-08-06T00:40:10Z","receivedAt":"2011-08-06T00:40:10Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"The current perl Net::SMTP support will not use AUTH LOGIN\nwhen other authentication options are available.\n\nAdd an option to force the use of AUTH LOGIN when necessary.\n(Like when using my current hosted email server, grumble)\n\nSigned-off-by: Joe Perches <joe@perches.com>\n---\n Documentation/git-send-email.txt |    3 +++\n git-send-email.perl              |   19 +++++++++++++++++--\n 2 files changed, 20 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 327233c..9595773 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -198,6 +198,9 @@ must be used for each option.\n \tif a username is not specified (with '--smtp-user' or 'sendemail.smtpuser'),\n \tthen authentication is not attempted.\n \n+--smtp-auth=<authorization_type>::\n+\tForce the smtp authentication to use a particular type.\n+\tCurrently supported forced style is \"login\"\n \n Automating\n ~~~~~~~~~~\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 98ab33a..37dfbe7 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -28,6 +28,7 @@ use File::Temp qw/ tempdir tempfile /;\n use File::Spec::Functions qw(catfile);\n use Error qw(:try);\n use Git;\n+use MIME::Base64;\n \n Getopt::Long::Configure qw/ pass_through /;\n \n@@ -193,7 +194,7 @@ sub do_edit {\n my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc);\n my ($to_cmd, $cc_cmd);\n my ($smtp_server, $smtp_server_port, @smtp_server_options);\n-my ($smtp_authuser, $smtp_encryption);\n+my ($smtp_authuser, $smtp_encryption, $smtp_auth);\n my ($identity, $aliasfiletype, @alias_files, $smtp_domain);\n my ($validate, $confirm);\n my (@suppress_cc);\n@@ -218,6 +219,7 @@ my %config_settings = (\n     \"smtpserveroption\" => \\@smtp_server_options,\n     \"smtpuser\" => \\$smtp_authuser,\n     \"smtppass\" => \\$smtp_authpass,\n+    \"smtpauth\" => \\$smtp_auth,\n     \"smtpdomain\" => \\$smtp_domain,\n     \"to\" => \\@initial_to,\n     \"tocmd\" => \\$to_cmd,\n@@ -293,6 +295,7 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n \t\t    \"smtp-pass:s\" => \\$smtp_authpass,\n \t\t    \"smtp-ssl\" => sub { $smtp_encryption = 'ssl' },\n \t\t    \"smtp-encryption=s\" => \\$smtp_encryption,\n+\t\t    \"smtp-auth=s\" => \\$smtp_auth,\n \t\t    \"smtp-debug:i\" => \\$debug_net_smtp,\n \t\t    \"smtp-domain:s\" => \\$smtp_domain,\n \t\t    \"identity=s\" => \\$identity,\n@@ -1111,7 +1114,19 @@ X-Mailer: git-send-email $gitversion\n \t\t\t\tsystem \"stty echo\";\n \t\t\t}\n \n-\t\t\t$auth ||= $smtp->auth( $smtp_authuser, $smtp_authpass ) or die $smtp->message;\n+\t\t\tif (defined $smtp_auth && $smtp_auth =~ /^login$/i) {\n+\n+\t\t\t    $smtp->datasend(\"AUTH LOGIN\\n\");\n+\t\t\t    $smtp->response();\n+\t\t\t    $smtp->datasend(encode_base64(\"$smtp_authuser\"));\n+\t\t\t    $smtp->response();\n+\t\t\t    $smtp->datasend(encode_base64(\"$smtp_authpass\"));\n+\t\t\t    $smtp->response();\n+\n+\t\t\t} else {\n+\n+\t\t\t    $auth ||= $smtp->auth( $smtp_authuser, $smtp_authpass ) or die $smtp->message;\n+\t\t\t}\n \t\t}\n \n \t\t$smtp->mail( $raw_from ) or die $smtp->message;\n-- \n1.7.6.131.g99019\n"},{"id":"173004","messageId":"7vzkjn16n6.fsf@alter.siamese.dyndns.org","threadId":"28030","inReplyTo":"c1be0c3bd05779897fdc92907fe65d84c88ac72b.1312591104.git.joe@perches.com","subject":"Re: [PATCH] git-send-email: Add AUTH LOGIN support","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-08-06T04:54:53Z","receivedAt":"2011-08-06T04:54:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Joe Perches <joe@perches.com> writes:\n\n> The current perl Net::SMTP support will not use AUTH LOGIN\n> when other authentication options are available.\n\nEven after reading this excuse,...\n\n> +\t\t\tif (defined $smtp_auth && $smtp_auth =~ /^login$/i) {\n> +\n> +\t\t\t    $smtp->datasend(\"AUTH LOGIN\\n\");\n> +\t\t\t    $smtp->response();\n> +\t\t\t    $smtp->datasend(encode_base64(\"$smtp_authuser\"));\n> +\t\t\t    $smtp->response();\n> +\t\t\t    $smtp->datasend(encode_base64(\"$smtp_authpass\"));\n> +\t\t\t    $smtp->response();\n> +\n> +\t\t\t} else {\n> +\n> +\t\t\t    $auth ||= $smtp->auth( $smtp_authuser, $smtp_authpass ) or die $smtp->message;\n> +\t\t\t}\n\n... this makes me feel dirty X-(. Not the desire to force \"AUTH LOGIN\",\nbut the implementation to hand-roll the protocol exchange.\n\nI'd rather want to know _why_ Net::SMTP does not support it in the first\nplace, and what it does for \"other authentication options\" that are\navailable. Does it try them in turn until it finds the one that works? Why\ndoesn't it fall back on \"AUTH LOGIN\" then?\n\nSpecifically, if there is a reason to avoid this plaintext authentication\nmethod when other options are _available_ (which presumably would be the\nreason why Net::SMTP chooses not to support it), and if there is a reason\non the user's side to _force_ this method even when people who wrote\nNet::SMTP does not recommend it be used, wouldn't it be natural to expect\nthat there should be a way to configure the connection to use it, without\nresorting to coding the protocol exchange by hand line this?\n\nIt probably is not as simple as installing Authen::SASL::*::LOGIN, but\nstill...\n"},{"id":"173007","messageId":"1312608114.6419.18.camel@Joe-Laptop","threadId":"28030","inReplyTo":"7vzkjn16n6.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-send-email: Add AUTH LOGIN support","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2011-08-06T05:21:54Z","receivedAt":"2011-08-06T05:21:54Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"On Fri, 2011-08-05 at 21:54 -0700, Junio C Hamano wrote:\n> Joe Perches <joe@perches.com> writes:\n> > The current perl Net::SMTP support will not use AUTH LOGIN\n> > when other authentication options are available.\n> Even after reading this excuse,...\n> > +\t\t\tif (defined $smtp_auth && $smtp_auth =~ /^login$/i) {\n> > +\n> > +\t\t\t    $smtp->datasend(\"AUTH LOGIN\\n\");\n> > +\t\t\t    $smtp->response();\n> > +\t\t\t    $smtp->datasend(encode_base64(\"$smtp_authuser\"));\n> > +\t\t\t    $smtp->response();\n> > +\t\t\t    $smtp->datasend(encode_base64(\"$smtp_authpass\"));\n> > +\t\t\t    $smtp->response();\n> > +\n> > +\t\t\t} else {\n> > +\n> > +\t\t\t    $auth ||= $smtp->auth( $smtp_authuser, $smtp_authpass ) or die $smtp->message;\n> > +\t\t\t}\n> ... this makes me feel dirty X-(. Not the desire to force \"AUTH LOGIN\",\n> but the implementation to hand-roll the protocol exchange.\n> I'd rather want to know _why_ Net::SMTP does not support it in the first\n> place, and what it does for \"other authentication options\" that are\n> available. Does it try them in turn until it finds the one that works? Why\n> doesn't it fall back on \"AUTH LOGIN\" then?\n> Specifically, if there is a reason to avoid this plaintext authentication\n> method when other options are _available_ (which presumably would be the\n> reason why Net::SMTP chooses not to support it), and if there is a reason\n> on the user's side to _force_ this method even when people who wrote\n> Net::SMTP does not recommend it be used, wouldn't it be natural to expect\n> that there should be a way to configure the connection to use it, without\n> resorting to coding the protocol exchange by hand line this?\n\nI needed something now.\n\nYou are right but I believe it would take too long\nto get updates to Net::SMTP in place. Doing this\nadmitted ugliness in git-send-email works for me and\nseems to me to be appropriate for now.\n\nI looked, there isn't a method to force a particular\nAUTH type documented.  I also didn't care to rewrite\nNet::SMTP right now.  This \"works for me\"...\n\n> It probably is not as simple as installing Authen::SASL::*::LOGIN, but\n> still...\n\ncheers, Joe\n"},{"id":"173825","messageId":"1313716585.11178.2.camel@Joe-Laptop","threadId":"28030","inReplyTo":"1312608114.6419.18.camel@Joe-Laptop","subject":"Re: [PATCH] git-send-email: Add AUTH LOGIN support","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2011-08-19T01:16:25Z","receivedAt":"2011-08-19T01:16:25Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"On Fri, 2011-08-05 at 22:21 -0700, Joe Perches wrote:\n> On Fri, 2011-08-05 at 21:54 -0700, Junio C Hamano wrote:\n> > Joe Perches <joe@perches.com> writes:\n> > > The current perl Net::SMTP support will not use AUTH LOGIN\n> > > when other authentication options are available.\n> > Even after reading this excuse,...\n> > > +\t\t\tif (defined $smtp_auth && $smtp_auth =~ /^login$/i) {\n> > > +\n> > > +\t\t\t    $smtp->datasend(\"AUTH LOGIN\\n\");\n> > > +\t\t\t    $smtp->response();\n> > > +\t\t\t    $smtp->datasend(encode_base64(\"$smtp_authuser\"));\n> > > +\t\t\t    $smtp->response();\n> > > +\t\t\t    $smtp->datasend(encode_base64(\"$smtp_authpass\"));\n> > > +\t\t\t    $smtp->response();\n> > > +\n> > > +\t\t\t} else {\n> > > +\n> > > +\t\t\t    $auth ||= $smtp->auth( $smtp_authuser, $smtp_authpass ) or die $smtp->message;\n> > > +\t\t\t}\n> > ... this makes me feel dirty X-(. Not the desire to force \"AUTH LOGIN\",\n> > but the implementation to hand-roll the protocol exchange.\n> > I'd rather want to know _why_ Net::SMTP does not support it in the first\n> > place, and what it does for \"other authentication options\" that are\n> > available. Does it try them in turn until it finds the one that works? Why\n> > doesn't it fall back on \"AUTH LOGIN\" then?\n> > Specifically, if there is a reason to avoid this plaintext authentication\n> > method when other options are _available_ (which presumably would be the\n> > reason why Net::SMTP chooses not to support it), and if there is a reason\n> > on the user's side to _force_ this method even when people who wrote\n> > Net::SMTP does not recommend it be used, wouldn't it be natural to expect\n> > that there should be a way to configure the connection to use it, without\n> > resorting to coding the protocol exchange by hand line this?\n> \n> I needed something now.\n> \n> You are right but I believe it would take too long\n> to get updates to Net::SMTP in place. Doing this\n> admitted ugliness in git-send-email works for me and\n> seems to me to be appropriate for now.\n> \n> I looked, there isn't a method to force a particular\n> AUTH type documented.  I also didn't care to rewrite\n> Net::SMTP right now.  This \"works for me\"...\n> \n> > It probably is not as simple as installing Authen::SASL::*::LOGIN, but\n> > still...\n\nI think my patch should be applied until Net::SMTP is updated.\n"},{"id":"173901","messageId":"7v1uwh0zj4.fsf@alter.siamese.dyndns.org","threadId":"28030","inReplyTo":"1313716585.11178.2.camel@Joe-Laptop","subject":"Re: [PATCH] git-send-email: Add AUTH LOGIN support","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-08-19T23:09:19Z","receivedAt":"2011-08-19T23:09:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Joe Perches <joe@perches.com> writes:\n\n> On Fri, 2011-08-05 at 22:21 -0700, Joe Perches wrote:\n>> \n>> I needed something now.\n>> \n>> You are right but I believe it would take too long\n>> to get updates to Net::SMTP in place. Doing this\n>> admitted ugliness in git-send-email works for me and\n>> seems to me to be appropriate for now.\n>> \n>> I looked, there isn't a method to force a particular\n>> AUTH type documented.  I also didn't care to rewrite\n>> Net::SMTP right now.  This \"works for me\"...\n\nGood for you ;-)\n\n>> > It probably is not as simple as installing Authen::SASL::*::LOGIN, but\n>> > still...\n>\n> I think my patch should be applied until Net::SMTP is updated.\n\nAnd you already have applied to your copy, no?\n\nI understand you needed something _now_ and that is why you wrote it, but\nthe thing is, I don't need the ugliness nor an ability to force AUTH LOGIN\nright now, so I do not necessarily agree with you that the patch _should_\nbe applied to my tree.\n"},{"id":"173902","messageId":"1313796280.11178.25.camel@Joe-Laptop","threadId":"28030","inReplyTo":"7v1uwh0zj4.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-send-email: Add AUTH LOGIN support","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2011-08-19T23:24:40Z","receivedAt":"2011-08-19T23:24:40Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"On Fri, 2011-08-19 at 16:09 -0700, Junio C Hamano wrote:\n> Joe Perches <joe@perches.com> writes:\n> > I think my patch should be applied until Net::SMTP is updated.\n> And you already have applied to your copy, no?\n\nTrue.\n\n> I do not necessarily agree with you that the patch _should_\n> be applied to my tree.\n\nYour choice.  It does make tracking git development\na bit of a pain for me though.\n\nThere doesn't seem to be anything like a patchwork queue\nfor git development to check status of patches.\n\nI've sent a couple of other patches to git-send-email.\n\nhttp://marc.info/?l=git&m=131190328311281&w=2\nhttp://marc.info/?l=git&m=131131975804893&w=2\n\nAny comments or plans to ack/nack those?\n"},{"id":"173904","messageId":"7vsjowzyj8.fsf@alter.siamese.dyndns.org","threadId":"28030","inReplyTo":"1313796280.11178.25.camel@Joe-Laptop","subject":"Re: [PATCH] git-send-email: Add AUTH LOGIN support","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-08-20T01:01:31Z","receivedAt":"2011-08-20T01:01:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Joe Perches <joe@perches.com> writes:\n\n> I've sent a couple of other patches to git-send-email.\n>\n> http://marc.info/?l=git&m=131190328311281&w=2\n> http://marc.info/?l=git&m=131131975804893&w=2\n>\n> Any comments or plans to ack/nack those?\n\nSorry, but I am not personally interested in send-email enough to go to\nmarc.info archive that does not give me the message in ready-to-apply\nformat with \"git am\". \n\n\nOn-list discussion is the most important signal I use to convince myself\nthat the issues that discussed patches attempt to tackle are worth\naddressing. When I do not see any discussion, I myself may decide that\nthey are important, or I may not.\n\nRe-sending them might get others with similar needs for the patches\ninvolved in the discussion.\n\nHere are what _I_ think about the above two.\n\n - I've seen enough complaints that send-email sends too many Cc:s to\n   unintended parties, and of an opinion that these extra recipients should\n   be added to the files you feed to send-email as headers, instead of adding\n   noise to commit log messages, so adding new Cc sources and then giving a\n   way to suppress them didn't look like a good change to me.\n\n - I think I saw a few positive responses to the \"editor cruft\" patch, but\n   the way the patch was implemented, it will invite low-value \"my obscure\n   editor uses this pattern, so add it\" follow-up patches, and compared to\n   that downside, I didn't like the benefit of the patch well enough to pick\n   it up.\n"},{"id":"176129","messageId":"1316879367-1182-1-git-send-email-zbyszek@in.waw.pl","threadId":"28030","inReplyTo":"7vzkjn16n6.fsf@alter.siamese.dyndns.org","subject":"[PATCH] send-email: auth plain/login fix","fromName":"Zbigniew Jędrzejewski-Szmek","fromEmail":"zbyszek@in.waw.pl","sentAt":"2011-09-24T15:49:27Z","receivedAt":"2011-09-24T15:49:27Z","isPatch":true,"sender":{"key":"zbyszek@in.waw.pl","avatar":"https://avatars.githubusercontent.com/u/349618?v=4"},"body":"git send-email was not authenticating properly when communicating over\nTLS with a server supporting only AUTH PLAIN and AUTH LOGIN. This is\ne.g. the standard server setup under debian with exim4 and probably\neverywhere where system accounts are used.\n\nThe solution comes from this forum thread:\nhttp://www.perlmonks.org/?node_id=904354\n\nThis patch is tested by sending it.\n\nBefore:\nNet::SMTP>>> Net::SMTP(2.31)\nNet::SMTP>>>   Net::Cmd(2.29)\nNet::SMTP>>>     Exporter(5.64_01)\nNet::SMTP>>>   IO::Socket::INET(1.31)\nNet::SMTP>>>     IO::Socket(1.31)\nNet::SMTP>>>       IO::Handle(1.28)\n...\nNet::SMTP=GLOB(0x238f668)>>> STARTTLS\nNet::SMTP=GLOB(0x238f668)<<< 220 2.0.0 Ready to start TLS\nNet::SMTP::SSL=GLOB(0x238f668)>>> EHLO localhost.localdomain\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-yyy.yyy.yyy Hello xxx.xxx [xxx.xxx.xxx.xxx], pleased to meet you\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-ENHANCEDSTATUSCODES\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-PIPELINING\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-8BITMIME\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-SIZE 80000000\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-DSN\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-AUTH=LOGIN PLAIN\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-AUTH LOGIN PLAIN\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-DELIVERBY\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250 HELP\nPassword:\nNet::SMTP::SSL=GLOB(0x238f668)>>> AUTH\nNet::SMTP::SSL=GLOB(0x238f668)<<< 501 5.5.2 AUTH mechanism must be specified\n5.5.2 AUTH mechanism must be specified\n\nAfter:\nNet::SMTP=GLOB(0x1ac4a60)>>> STARTTLS\nNet::SMTP=GLOB(0x1ac4a60)<<< 220 2.0.0 Ready to start TLS\nNet::SMTP::SSL=GLOB(0x1ac4a60)>>> EHLO localhost.localdomain\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-yyy.yyy.yyy Hello xxx.xxx [xxx.xxx.xxx.xxx], pleased to meet you\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-ENHANCEDSTATUSCODES\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-PIPELINING\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-8BITMIME\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-SIZE 80000000\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-DSN\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-AUTH=LOGIN PLAIN\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-AUTH LOGIN PLAIN\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-DELIVERBY\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250 HELP\nPassword:\nNet::SMTP::SSL=GLOB(0x1ac4a60)>>> AUTH LOGIN\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 334 VXNlcm5hbWU6\nNet::SMTP::SSL=GLOB(0x1ac4a60)>>> emJ5c3plaw==\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 334 UGFzc3dvcmQ6\nNet::SMTP::SSL=GLOB(0x1ac4a60)>>> dGVzdA==\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 535 5.7.0 authentication failed\n5.7.0 authentication failed\n\nThe password is incorrect in this snippet, but the protocol works correctly.\n---\n git-send-email.perl |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git git-send-email.perl git-send-email.perl\nindex 37dfbe7..100fbd9 100755\n--- git-send-email.perl\n+++ git-send-email.perl\n@@ -27,6 +27,7 @@ use Term::ANSIColor;\n use File::Temp qw/ tempdir tempfile /;\n use File::Spec::Functions qw(catfile);\n use Error qw(:try);\n+use Authen::SASL qw(Perl);\n use Git;\n use MIME::Base64;\n \n-- \n1.7.6\n"},{"id":"176223","messageId":"7v8vpb5kea.fsf@alter.siamese.dyndns.org","threadId":"28030","inReplyTo":"1316879367-1182-1-git-send-email-zbyszek@in.waw.pl","subject":"Re: [PATCH] send-email: auth plain/login fix","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-26T16:38:21Z","receivedAt":"2011-09-26T16:38:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:\n\n> git send-email was not authenticating properly when communicating over\n> TLS with a server supporting only AUTH PLAIN and AUTH LOGIN. This is\n> e.g. the standard server setup under debian with exim4 and probably\n> everywhere where system accounts are used.\n\nNow that's a solution that makes me feel less dirty than\n\n  http://thread.gmane.org/gmane.comp.version-control.git/178818/focus=178824\n\neven though, by forcing Authen::SASL::Perl to be used bypassing XS and\nCyrus variants, this _might_ be introducing regression for others. We'll\nfind out soon enough if anybody screams ;-)\n\nI see you already researched previous discussion and have Joe Perches in\nthe loop; Thanks.\n"},{"id":"176229","messageId":"1317056343.14197.2.camel@Joe-Laptop","threadId":"28030","inReplyTo":"7v8vpb5kea.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] send-email: auth plain/login fix","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2011-09-26T16:59:03Z","receivedAt":"2011-09-26T16:59:03Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"On Mon, 2011-09-26 at 09:38 -0700, Junio C Hamano wrote:\n> Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:\n> \n> > git send-email was not authenticating properly when communicating over\n> > TLS with a server supporting only AUTH PLAIN and AUTH LOGIN. This is\n> > e.g. the standard server setup under debian with exim4 and probably\n> > everywhere where system accounts are used.\n> \n> Now that's a solution that makes me feel less dirty than\n> \n>   http://thread.gmane.org/gmane.comp.version-control.git/178818/focus=178824\n\nDirty is dirty.  I don't see this as better or worse really,\nbut thanks Zbigniew for bringing it up again.\n\nIt'd be best if Graham Barr, the module author (cc'd),\ncould respond to the issue.\n\ncheers, Joe\n\n> even though, by forcing Authen::SASL::Perl to be used bypassing XS and\n> Cyrus variants, this _might_ be introducing regression for others. We'll\n> find out soon enough if anybody screams ;-)\n> \n> I see you already researched previous discussion and have Joe Perches in\n> the loop; Thanks.\n"},{"id":"176232","messageId":"m3fwjjp69m.fsf@localhost.localdomain","threadId":"28030","inReplyTo":"1316879367-1182-1-git-send-email-zbyszek@in.waw.pl","subject":"Re: [PATCH] send-email: auth plain/login fix","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-09-26T17:24:21Z","receivedAt":"2011-09-26T17:24:21Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:\n\n> git send-email was not authenticating properly when communicating over\n> TLS with a server supporting only AUTH PLAIN and AUTH LOGIN. This is\n> e.g. the standard server setup under debian with exim4 and probably\n> everywhere where system accounts are used.\n> \n> The solution comes from this forum thread:\n> http://www.perlmonks.org/?node_id=904354\n\nSignoff?\n\n> ---\n>  git-send-email.perl |    1 +\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n> \n> diff --git git-send-email.perl git-send-email.perl\n> index 37dfbe7..100fbd9 100755\n> --- git-send-email.perl\n> +++ git-send-email.perl\n> @@ -27,6 +27,7 @@ use Term::ANSIColor;\n>  use File::Temp qw/ tempdir tempfile /;\n>  use File::Spec::Functions qw(catfile);\n>  use Error qw(:try);\n> +use Authen::SASL qw(Perl);\n>  use Git;\n>  use MIME::Base64;\n\nShouldn't we load Authen::SASL only when it is necessary (on demand),\nrather than forcing everybody who use send-email (even if via\nsendmail, or with other authentication support)?\n\nWe load Net::SMTP::SSL only on demand.  \n\nIt would be:\n\n   require Authen::SASL;\n   Authen::SASL->import(qw(Perl));\n\n-- \nJakub Narębski\n"},{"id":"176359","messageId":"1317159419-23166-1-git-send-email-zbyszek@in.waw.pl","threadId":"28030","inReplyTo":"m3fwjjp69m.fsf@localhost.localdomain","subject":"[PATCH v2] send-email: auth plain/login fix","fromName":"Zbigniew Jędrzejewski-Szmek","fromEmail":"zbyszek@in.waw.pl","sentAt":"2011-09-27T21:36:59Z","receivedAt":"2011-09-27T21:36:59Z","isPatch":true,"sender":{"key":"zbyszek@in.waw.pl","avatar":"https://avatars.githubusercontent.com/u/349618?v=4"},"body":"git send-email was not authenticating properly when communicating over\nTLS with a server supporting only AUTH PLAIN and AUTH LOGIN. This is\ne.g. the standard server setup under debian with exim4 and probably\neverywhere where system accounts are used.\n\nThe solution comes from this forum thread:\nhttp://www.perlmonks.org/?node_id=904354\n\nThis patch is tested by sending it :)\n\nBefore:\nNet::SMTP>>> Net::SMTP(2.31)\nNet::SMTP>>>   Net::Cmd(2.29)\nNet::SMTP>>>     Exporter(5.64_01)\nNet::SMTP>>>   IO::Socket::INET(1.31)\nNet::SMTP>>>     IO::Socket(1.31)\nNet::SMTP>>>       IO::Handle(1.28)\n...\nNet::SMTP=GLOB(0x238f668)>>> STARTTLS\nNet::SMTP=GLOB(0x238f668)<<< 220 2.0.0 Ready to start TLS\nNet::SMTP::SSL=GLOB(0x238f668)>>> EHLO localhost.localdomain\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-yyy.yyy.yyy Hello xxx.xxx [xxx.xxx.xxx.xxx], pleased to meet you\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-ENHANCEDSTATUSCODES\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-PIPELINING\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-8BITMIME\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-SIZE 80000000\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-DSN\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-AUTH=LOGIN PLAIN\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-AUTH LOGIN PLAIN\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-DELIVERBY\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250 HELP\nPassword:\nNet::SMTP::SSL=GLOB(0x238f668)>>> AUTH\nNet::SMTP::SSL=GLOB(0x238f668)<<< 501 5.5.2 AUTH mechanism must be specified\n5.5.2 AUTH mechanism must be specified\n\nAfter:\nNet::SMTP=GLOB(0x1ac4a60)>>> STARTTLS\nNet::SMTP=GLOB(0x1ac4a60)<<< 220 2.0.0 Ready to start TLS\nNet::SMTP::SSL=GLOB(0x1ac4a60)>>> EHLO localhost.localdomain\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-yyy.yyy.yyy Hello xxx.xxx [xxx.xxx.xxx.xxx], pleased to meet you\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-ENHANCEDSTATUSCODES\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-PIPELINING\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-8BITMIME\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-SIZE 80000000\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-DSN\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-AUTH=LOGIN PLAIN\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-AUTH LOGIN PLAIN\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-DELIVERBY\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250 HELP\nPassword:\nNet::SMTP::SSL=GLOB(0x1ac4a60)>>> AUTH LOGIN\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 334 VXNlcm5hbWU6\nNet::SMTP::SSL=GLOB(0x1ac4a60)>>> emJ5c3plaw==\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 334 UGFzc3dvcmQ6\nNet::SMTP::SSL=GLOB(0x1ac4a60)>>> dGVzdA==\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 535 5.7.0 authentication failed\n5.7.0 authentication failed\n\nThe password is incorrect in this snippet, but the protocol works correctly.\n\nSigned-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>\n---\n v2: - added sign-off as requested, although the patch is as trivial\n       as it gets\n     - the import is performed only if it will be used\n\n git-send-email.perl |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 37dfbe7..5a22d18 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1098,6 +1098,8 @@ X-Mailer: git-send-email $gitversion\n \t\t}\n \n \t\tif (defined $smtp_authuser) {\n+\t\t\trequire Authen::SASL;\n+\t\t\tAuthen::SASL->import(qw(Perl));\n \n \t\t\tif (!defined $smtp_authpass) {\n \n-- \n1.7.6\n"},{"id":"176361","messageId":"20110927214817.GD5176@sigill.intra.peff.net","threadId":"28030","inReplyTo":"1317159419-23166-1-git-send-email-zbyszek@in.waw.pl","subject":"Re: [PATCH v2] send-email: auth plain/login fix","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-09-27T21:48:17Z","receivedAt":"2011-09-27T21:48:17Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Sep 27, 2011 at 11:36:59PM +0200, Zbigniew Jędrzejewski-Szmek wrote:\n\n>  v2: - added sign-off as requested, although the patch is as trivial\n>        as it gets\n>      - the import is performed only if it will be used\n\nNice, it's much better not to make the dependency required by people who\nare not using smtp auth, but...\n\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 37dfbe7..5a22d18 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -1098,6 +1098,8 @@ X-Mailer: git-send-email $gitversion\n>  \t\t}\n>  \n>  \t\tif (defined $smtp_authuser) {\n> +\t\t\trequire Authen::SASL;\n> +\t\t\tAuthen::SASL->import(qw(Perl));\n\nWhat about people who are using smtp auth, but don't need or have\nAuthen::SASL? I.e., shouldn't this be:\n\n  eval {\n    require Authen::SASL;\n    Authen::SASL->import(qw(Perl));\n  }\n\nand if we hit an error, just ignore it and continue without Authen::SASL\nloaded?\n\n-Peff\n"},{"id":"176397","messageId":"1317205600-7210-1-git-send-email-zbyszek@in.waw.pl","threadId":"28030","inReplyTo":"m3fwjjp69m.fsf@localhost.localdomain","subject":"[PATCH v3] send-email: auth plain/login fix","fromName":"Zbigniew Jędrzejewski-Szmek","fromEmail":"zbyszek@in.waw.pl","sentAt":"2011-09-28T10:26:40Z","receivedAt":"2011-09-28T10:26:40Z","isPatch":true,"sender":{"key":"zbyszek@in.waw.pl","avatar":"https://avatars.githubusercontent.com/u/349618?v=4"},"body":"git send-email was not authenticating properly when communicating over\nTLS with a server supporting only AUTH PLAIN and AUTH LOGIN. This is\ne.g. the standard server setup under debian with exim4 and probably\neverywhere where system accounts are used.\n\nThe problem (only?) exists when libauthen-sasl-cyrus-perl\n(Authen::SASL::Cyrus) is installed. Importing Authen::SASL::Perl\nmakes Authen::SASL use the perl implementation which works\nbetter.\n\nThe solution is based on this forum thread:\nhttp://www.perlmonks.org/?node_id=904354.\n\nThis patch is tested by sending it :)\n\nBefore:\nNet::SMTP>>> Net::SMTP(2.31)\nNet::SMTP>>>   Net::Cmd(2.29)\nNet::SMTP>>>     Exporter(5.64_01)\nNet::SMTP>>>   IO::Socket::INET(1.31)\nNet::SMTP>>>     IO::Socket(1.31)\nNet::SMTP>>>       IO::Handle(1.28)\n...\nNet::SMTP=GLOB(0x238f668)>>> STARTTLS\nNet::SMTP=GLOB(0x238f668)<<< 220 2.0.0 Ready to start TLS\nNet::SMTP::SSL=GLOB(0x238f668)>>> EHLO localhost.localdomain\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-yyy.yyy.yyy Hello xxx.xxx [xxx.xxx.xxx.xxx], pleased to meet you\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-ENHANCEDSTATUSCODES\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-PIPELINING\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-8BITMIME\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-SIZE 80000000\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-DSN\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-AUTH=LOGIN PLAIN\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-AUTH LOGIN PLAIN\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-DELIVERBY\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250 HELP\nPassword:\nNet::SMTP::SSL=GLOB(0x238f668)>>> AUTH\nNet::SMTP::SSL=GLOB(0x238f668)<<< 501 5.5.2 AUTH mechanism must be specified\n5.5.2 AUTH mechanism must be specified\n\nAfter:\nNet::SMTP=GLOB(0x1ac4a60)>>> STARTTLS\nNet::SMTP=GLOB(0x1ac4a60)<<< 220 2.0.0 Ready to start TLS\nNet::SMTP::SSL=GLOB(0x1ac4a60)>>> EHLO localhost.localdomain\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-yyy.yyy.yyy Hello xxx.xxx [xxx.xxx.xxx.xxx], pleased to meet you\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-ENHANCEDSTATUSCODES\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-PIPELINING\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-8BITMIME\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-SIZE 80000000\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-DSN\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-AUTH=LOGIN PLAIN\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-AUTH LOGIN PLAIN\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250-DELIVERBY\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 250 HELP\nPassword:\nNet::SMTP::SSL=GLOB(0x1ac4a60)>>> AUTH LOGIN\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 334 VXNlcm5hbWU6\nNet::SMTP::SSL=GLOB(0x1ac4a60)>>> emJ5c3plaw==\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 334 UGFzc3dvcmQ6\nNet::SMTP::SSL=GLOB(0x1ac4a60)>>> dGVzdA==\nNet::SMTP::SSL=GLOB(0x1ac4a60)<<< 535 5.7.0 authentication failed\n5.7.0 authentication failed\n\nThe password is incorrect in this snippet, but the protocol works correctly.\n\nSigned-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>\n---\nv3:  - the import is performed only if it will be used, and failure is ignored\n\n git-send-email.perl |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 37dfbe7..dbc435a 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1098,6 +1098,10 @@ X-Mailer: git-send-email $gitversion\n \t\t}\n \n \t\tif (defined $smtp_authuser) {\n+\t\t\teval {\n+\t\t\t\trequire Authen::SASL;\n+\t\t\t\tAuthen::SASL->import(qw(Perl));\n+\t\t\t};\n \n \t\t\tif (!defined $smtp_authpass) {\n \n-- \n1.7.6\n"},{"id":"176455","messageId":"7v62kcz5rr.fsf@alter.siamese.dyndns.org","threadId":"28030","inReplyTo":"1317205600-7210-1-git-send-email-zbyszek@in.waw.pl","subject":"Re: [PATCH v3] send-email: auth plain/login fix","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-28T22:00:40Z","receivedAt":"2011-09-28T22:00:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:\n\n> This patch is tested by sending it :)\n\nI am tempted to shorten the log message to cull the protocol trace.\n\n    send-email: auth plain/login fix\n    \n    git send-email does not authenticate properly when communicating over TLS\n    with a server supporting only AUTH PLAIN and AUTH LOGIN. This is e.g. the\n    standard server setup under debian with exim4 and probably everywhere\n    where system accounts are used.\n    \n    The problem (only?) exists when libauthen-sasl-cyrus-perl (Authen::SASL::Cyrus)\n    is installed. Importing Authen::SASL::Perl makes Authen::SASL use the perl\n    implementation, which works better.\n    \n    The solution is based on this forum thread:\n    \n        http://www.perlmonks.org/?node_id=904354\n    \n    This patch is tested by sending it. Without this fix, the interaction with\n    the server failed like this:\n    \n        ...\n        Password:\n        Net::SMTP::SSL=GLOB(0x238f668)>>> AUTH\n        Net::SMTP::SSL=GLOB(0x238f668)<<< 501 5.5.2 AUTH mechanism must be specified\n        5.5.2 AUTH mechanism must be specified\n    \n    Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>\n    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nAround the line \"the server failed like this:\", it would be helpful if we\ncan say how others can reproduce the protocol exchange log shown above.\nThat would help those who may (or may not) be seeing a similar issue to\ndiagnose if this commit may help them (or is the culprit of a breakage\nthey find in the future).\n\nThanks.\n"},{"id":"176485","messageId":"20110929141616.GU10763@in.waw.pl","threadId":"28030","inReplyTo":"7v62kcz5rr.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4] send-email: auth plain/login fix","fromName":"Zbigniew Jędrzejewski-Szmek","fromEmail":"zbyszek@in.waw.pl","sentAt":"2011-09-29T14:16:16Z","receivedAt":"2011-09-29T14:16:16Z","isPatch":true,"sender":{"key":"zbyszek@in.waw.pl","avatar":"https://avatars.githubusercontent.com/u/349618?v=4"},"body":"git send-email was not authenticating properly when communicating over\nTLS with a server supporting only AUTH PLAIN and AUTH LOGIN. This is\ne.g. the standard server setup under debian with exim4 and probably\neverywhere where system accounts are used.\n\nThe problem (only?) exists when libauthen-sasl-cyrus-perl\n(Authen::SASL::Cyrus) is installed. Importing Authen::SASL::Perl\nmakes Authen::SASL use the perl implementation which works\nbetter.\n\nThe solution is based on this forum thread:\nhttp://www.perlmonks.org/?node_id=904354.\n\nThis patch is tested by sending it. Without this fix, the interaction with\nthe server failed like this:\n\n$ git send-email --smtp-encryption=tls --smtp-server=... --smtp-debug=1 change1.patch\n...\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-AUTH LOGIN PLAIN\nPassword:\nNet::SMTP::SSL=GLOB(0x238f668)>>> AUTH\nNet::SMTP::SSL=GLOB(0x238f668)<<< 501 5.5.2 AUTH mechanism must be specified\n5.5.2 AUTH mechanism must be specified\n\nSigned-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n\n---\nv2:  - the import is performed only if it will be used\nv3:  - the import is performed only if it will be used, and failure is ignored\nv4:  - improved commit message\n\n git-send-email.perl |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 37dfbe7..dbc435a 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1098,6 +1098,10 @@ X-Mailer: git-send-email $gitversion\n \t\t}\n \n \t\tif (defined $smtp_authuser) {\n+\t\t\teval {\n+\t\t\t\trequire Authen::SASL;\n+\t\t\t\tAuthen::SASL->import(qw(Perl));\n+\t\t\t};\n \n \t\t\tif (!defined $smtp_authpass) {\n \n-- \n1.7.6\n"},{"id":"176492","messageId":"1317308474.1854.8.camel@Joe-Laptop","threadId":"28030","inReplyTo":"20110929141616.GU10763@in.waw.pl","subject":"Re: [PATCH v4] send-email: auth plain/login fix","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2011-09-29T15:01:14Z","receivedAt":"2011-09-29T15:01:14Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"On Thu, 2011-09-29 at 16:16 +0200, Zbigniew Jędrzejewski-Szmek wrote:\n> git send-email was not authenticating properly when communicating over\n> TLS with a server supporting only AUTH PLAIN and AUTH LOGIN. This is\n> e.g. the standard server setup under debian with exim4 and probably\n> everywhere where system accounts are used.\n> \n> The problem (only?) exists when libauthen-sasl-cyrus-perl\n> (Authen::SASL::Cyrus) is installed. Importing Authen::SASL::Perl\n> makes Authen::SASL use the perl implementation which works\n> better.\n[]\n> diff --git a/git-send-email.perl b/git-send-email.perl\n[]\n> @@ -1098,6 +1098,10 @@ X-Mailer: git-send-email $gitversion\n>  \t\t}\n>  \n>  \t\tif (defined $smtp_authuser) {\n> +\t\t\teval {\n> +\t\t\t\trequire Authen::SASL;\n> +\t\t\t\tAuthen::SASL->import(qw(Perl));\n> +\t\t\t};\n\nThanks for keeping at this.\n\nOne comment:\n\nThis is a workaround for a nominal defect.\n\nAs such, I think the code should be commented\nto note why it exists.\n\nHow about adding a comment like:\n\n \t\tif (defined $smtp_authuser) {\n\t\t\t# Workaround AUTH PLAIN/LOGIN interaction defect\n\t\t\t# with Authen::SASL::Cyrus\n\t\t\teval {\n\t\t\t\trequire Authen::SASL;\n"},{"id":"176502","messageId":"1317315765-5471-1-git-send-email-zbyszek@in.waw.pl","threadId":"28030","inReplyTo":"1317308474.1854.8.camel@Joe-Laptop","subject":"[PATCH] send-email: auth plain/login fix","fromName":"Zbigniew Jędrzejewski-Szmek","fromEmail":"zbyszek@in.waw.pl","sentAt":"2011-09-29T17:02:45Z","receivedAt":"2011-09-29T17:02:45Z","isPatch":true,"sender":{"key":"zbyszek@in.waw.pl","avatar":"https://avatars.githubusercontent.com/u/349618?v=4"},"body":"git send-email was not authenticating properly when communicating over\nTLS with a server supporting only AUTH PLAIN and AUTH LOGIN. This is\ne.g. the standard server setup under debian with exim4 and probably\neverywhere where system accounts are used.\n\nThe problem (only?) exists when libauthen-sasl-cyrus-perl\n(Authen::SASL::Cyrus) is installed. Importing Authen::SASL::Perl\nmakes Authen::SASL use the perl implementation which works\nbetter.\n\nThe solution is based on this forum thread:\nhttp://www.perlmonks.org/?node_id=904354.\n\nThis patch is tested by sending it. Without this fix, the interaction with\nthe server failed like this:\n\n$ git send-email --smtp-encryption=tls --smtp-server=... --smtp-debug=1 change1.patch\n...\nNet::SMTP::SSL=GLOB(0x238f668)<<< 250-AUTH LOGIN PLAIN\nPassword:\nNet::SMTP::SSL=GLOB(0x238f668)>>> AUTH\nNet::SMTP::SSL=GLOB(0x238f668)<<< 501 5.5.2 AUTH mechanism must be specified\n5.5.2 AUTH mechanism must be specified\n\nSigned-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\nv2:  - the import is performed only if it will be used\nv3:  - the import is performed only if it will be used, and failure is ignored\nv4:  - improved commit message\nv5:  - comment in code\n\n git-send-email.perl |    6 ++++++\n 1 files changed, 6 insertions(+), 0 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 98ab33a..f2a6e46 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1095,6 +1095,12 @@ X-Mailer: git-send-email $gitversion\n \t\t}\n \n \t\tif (defined $smtp_authuser) {\n+\t\t\t# Workaround AUTH PLAIN/LOGIN interaction defect\n+\t\t\t# with Authen::SASL::Cyrus\n+\t\t\teval {\n+\t\t\t\trequire Authen::SASL;\n+\t\t\t\tAuthen::SASL->import(qw(Perl));\n+\t\t\t};\n \n \t\t\tif (!defined $smtp_authpass) {\n \n-- \n1.7.6\n"},{"id":"176507","messageId":"7vipobtdyn.fsf@alter.siamese.dyndns.org","threadId":"28030","inReplyTo":"1317315765-5471-1-git-send-email-zbyszek@in.waw.pl","subject":"Re: [PATCH] send-email: auth plain/login fix","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-29T18:12:32Z","receivedAt":"2011-09-29T18:12:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}