aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-10-05 23:40:15 -0700
committerJunio C Hamano <junkio@cox.net>2006-10-05 23:40:15 -0700
commit7a2a0d214169a5d6f22fc62c4ae6a7ca5b27fb3e (patch)
treef59e51e784820ffcf4a58aa7db60917aa867c458
parentce91c2f6538fc4a905882f2a7a57d814d82b13e8 (diff)
downloadgit-7a2a0d214169a5d6f22fc62c4ae6a7ca5b27fb3e.tar.gz
git-7a2a0d214169a5d6f22fc62c4ae6a7ca5b27fb3e.tar.xz
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>
-rwxr-xr-xgit-send-email.perl5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 2fd5e8793..21b3686b2 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -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