Merge branch 'ew/rerere'
[gitweb.git] / git-send-email.perl
index b17d2619875112215465c7399fa30e592ed71b01..4c87c20c158fe3edfd0b770f1855e67e20038e3b 100755 (executable)
@@ -230,6 +230,9 @@ sub expand_aliases {
        $initial_reply_to =~ s/(^\s+|\s+$)//g;
 }
 
+if (!$smtp_server) {
+       $smtp_server = $repo->config('sendemail.smtpserver');
+}
 if (!$smtp_server) {
        foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {
                if (-x $_) {
@@ -412,7 +415,7 @@ sub send_message
        }
 
        my ($author_name) = ($from =~ /^(.*?)\s+</);
-       if ($author_name =~ /\./ && $author_name !~ /^".*"$/) {
+       if ($author_name && $author_name =~ /\./ && $author_name !~ /^".*"$/) {
                my ($name, $addr) = ($from =~ /^(.*?)(\s+<.*)/);
                $from = "\"$name\"$addr";
        }
@@ -514,7 +517,7 @@ sub send_message
                                                $2, $_) unless $quiet;
                                        push @cc, $2;
                                }
-                               elsif (/^[-A-Za-z]+:\s+\S/) {
+                               elsif (!/^Date:\s/ && /^[-A-Za-z]+:\s+\S/) {
                                        push @xh, $_;
                                }