Skip to content

Commit

Permalink
git-send-email: real name with period need to be dq-quoted on From: line
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Oct 6, 2006
1 parent ce91c2f commit 7a2a0d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,11 @@ sub send_message
$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
To: $to
Cc: $cc
Expand Down

0 comments on commit 7a2a0d2

Please sign in to comment.