Merge branch 'zj/send-email-authen-sasl'
authorJunio C Hamano <gitster@pobox.com>
Wed, 12 Oct 2011 19:34:03 +0000 (12:34 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Oct 2011 19:34:03 +0000 (12:34 -0700)
* zj/send-email-authen-sasl:
send-email: auth plain/login fix

1  2 
git-send-email.perl
diff --combined git-send-email.perl
index 734356a6fb3b22dceb4a1afe7751811628b60ce7,261200618d8002268979d92ae3462c972dad6ffd..8ded7f5ce3556acf69a2d88e8b9aedae1d5e2da6
@@@ -275,9 -275,7 +275,9 @@@ $SIG{INT}  = \&signal_handler
  # Begin by accumulating all the variables (defined above), that we will end up
  # needing, first, from the command line:
  
 -my $rc = GetOptions("sender|from=s" => \$sender,
 +my $help;
 +my $rc = GetOptions("h" => \$help,
 +                  "sender|from=s" => \$sender,
                      "in-reply-to=s" => \$initial_reply_to,
                    "subject=s" => \$initial_subject,
                    "to=s" => \@initial_to,
                    "force" => \$force,
         );
  
 +usage() if $help;
  unless ($rc) {
      usage();
  }
@@@ -1094,10 -1091,16 +1094,16 @@@ X-Mailer: git-send-email $gitversio
                            "VALUES: server=$smtp_server ",
                            "encryption=$smtp_encryption ",
                            "hello=$smtp_domain",
 -                          defined $smtp_server_port ? "port=$smtp_server_port" : "";
 +                          defined $smtp_server_port ? " port=$smtp_server_port" : "";
                }
  
                if (defined $smtp_authuser) {
+                       # Workaround AUTH PLAIN/LOGIN interaction defect
+                       # with Authen::SASL::Cyrus
+                       eval {
+                               require Authen::SASL;
+                               Authen::SASL->import(qw(Perl));
+                       };
  
                        if (!defined $smtp_authpass) {