X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-send-email.perl;h=d491db92c9379cf0eea63182dd704feb6582b6e7;hb=b13e3eacefc0fb6f4f89738f74ba5ef14437bed5;hp=98ab33aae7e35c2d288bc34ddb2bbc71f8a16cdd;hpb=e63f87a6f7a4e55f50e67b112f26d9a1e4e7f3ab;p=git.git diff --git a/git-send-email.perl b/git-send-email.perl index 98ab33aae..d491db92c 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -225,7 +225,6 @@ my %config_settings = ( "cccmd" => \$cc_cmd, "aliasfiletype" => \$aliasfiletype, "bcc" => \@bcclist, - "aliasesfile" => \@alias_files, "suppresscc" => \@suppress_cc, "envelopesender" => \$envelope_sender, "multiedit" => \$multiedit, @@ -234,6 +233,10 @@ my %config_settings = ( "assume8bitencoding" => \$auto_8bit_encoding, ); +my %config_path_settings = ( + "aliasesfile" => \@alias_files, +); + # Help users prepare for 1.7.0 sub chain_reply_to { if (defined $chain_reply_to && @@ -275,7 +278,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, @@ -313,6 +318,7 @@ my $rc = GetOptions("sender|from=s" => \$sender, "force" => \$force, ); +usage() if $help; unless ($rc) { usage(); } @@ -330,6 +336,19 @@ sub read_config { $$target = Git::config_bool(@repo, "$prefix.$setting") unless (defined $$target); } + foreach my $setting (keys %config_path_settings) { + my $target = $config_path_settings{$setting}; + if (ref($target) eq "ARRAY") { + unless (@$target) { + my @values = Git::config_path(@repo, "$prefix.$setting"); + @$target = @values if (@values && defined $values[0]); + } + } + else { + $$target = Git::config_path(@repo, "$prefix.$setting") unless (defined $$target); + } + } + foreach my $setting (keys %config_settings) { my $target = $config_settings{$setting}; next if $setting eq "to" and defined $no_to; @@ -1079,7 +1098,7 @@ X-Mailer: git-send-email $gitversion $smtp_encryption = ''; # Send EHLO again to receive fresh # supported commands - $smtp->hello(); + $smtp->hello($smtp_domain); } else { die "Server does not support STARTTLS! ".$smtp->message; } @@ -1095,6 +1114,12 @@ X-Mailer: git-send-email $gitversion } 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) {