X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-send-email.perl;h=6a285bfd214132f792f7493433a52019ba80b5ab;hb=b6936205e73c058784288d21d1937e5bba26b91b;hp=c42dc3bc943edb2e8f5d9e11a309f6e6d86848ab;hpb=9ee93dceb5dbef8052b0abde3eea94181bd9d95b;p=git.git diff --git a/git-send-email.perl b/git-send-email.perl index c42dc3bc9..6a285bfd2 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -178,11 +178,10 @@ my $prompting = 0; if (!defined $from) { $from = $author || $committer; do { - $_ = $term->readline("Who should the emails appear to be from? ", - $from); + $_ = $term->readline("Who should the emails appear to be from? [$from] "); } while (!defined $_); - $from = $_; + $from = $_ if ($_); print "Emails will be sent from: ", $from, "\n"; $prompting++; } @@ -230,6 +229,9 @@ if (!defined $initial_reply_to && $prompting) { $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 $_) { @@ -400,6 +402,15 @@ sub make_message_id $cc = ""; $time = time - scalar $#files; +sub unquote_rfc2047 { + local ($_) = @_; + if (s/=\?utf-8\?q\?(.*)\?=/$1/g) { + s/_/ /g; + s/=([0-9A-F]{2})/chr(hex($1))/eg; + } + return "$_"; +} + sub send_message { my @recipients = unique_email_list(@to); @@ -553,6 +564,7 @@ foreach my $t (@files) { } close F; if (defined $author_not_sender) { + $author_not_sender = unquote_rfc2047($author_not_sender); $message = "From: $author_not_sender\n\n$message"; }