t: send verbose test-helper output to fd 4
[gitweb.git] / git-send-email.perl
index 2208dcc2139be7130749fd3bae462320f17d3b21..bbf4deaa0d42ef2a843c2240000d7e34dfff0b62 100755 (executable)
 use Term::ANSIColor;
 use File::Temp qw/ tempdir tempfile /;
 use File::Spec::Functions qw(catdir catfile);
-use Error qw(:try);
+use Git::Error qw(:try);
 use Cwd qw(abs_path cwd);
 use Git;
 use Git::I18N;
+use Git::Mail::Address;
 
 Getopt::Long::Configure qw/ pass_through /;
 
@@ -489,7 +490,7 @@ sub read_config {
 ($repocommitter) = Git::ident_person(@repo, 'committer');
 
 sub parse_address_line {
-       return Git::parse_mailboxes($_[0]);
+       return map { $_->format } Mail::Address->parse($_[0]);
 }
 
 sub split_addrs {
@@ -885,7 +886,9 @@ sub expand_one_alias {
 }
 
 if (!defined $smtp_server) {
-       foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {
+       my @sendmail_paths = qw( /usr/sbin/sendmail /usr/lib/sendmail );
+       push @sendmail_paths, map {"$_/sendmail"} split /:/, $ENV{PATH};
+       foreach (@sendmail_paths) {
                if (-x $_) {
                        $smtp_server = $_;
                        last;