Browse Source

git-send-email: real name with period need to be dq-quoted on From: line

An author name like 'A. U. Thor <a.u.thor@example.com>" is not a
valid RFC 2822 address; when placing it on From: line, we would
need to quote it, like this:

Signed-off-by: "Junio C. Hamano" <junkio@cox.net>
maint
Junio C Hamano 18 years ago
parent
commit
7a2a0d2141
  1. 5
      git-send-email.perl

5
git-send-email.perl

@ -409,6 +409,11 @@ sub send_message
$gitversion = Git::version(); $gitversion = Git::version();
} }


my ($author_name) = ($from =~ /^(.*?)\s+</);
if ($author_name =~ /\./ && $author_name !~ /^".*"$/) {
my ($name, $addr) = ($from =~ /^(.*?)(\s+<.*)/);
$from = "\"$name\"$addr";
}
my $header = "From: $from my $header = "From: $from
To: $to To: $to
Cc: $cc Cc: $cc

Loading…
Cancel
Save