path: root/git-send-email.perl
diff options
authorJay Soffian <>2009-03-31 16:22:14 (GMT)
committerJunio C Hamano <>2009-04-02 17:46:21 (GMT)
commita61c0ffa4474ad6dcec18a5454630371106710f4 (patch)
tree13050336905d92f95adaaff77bc7629c8d053d7a /git-send-email.perl
parent3b3637c3f1d752e6e6d559f30cc53bbec18537ef (diff)
send-email: ensure quoted addresses are rfc2047 encoded
sanitize_address assumes that quoted addresses (e.g., "first last" < do not need rfc2047 encoding, but this is not always the case. For example, various places in send-email extract addresses using parse_address_line. parse_address_line returns the addresses already quoted (e.g., "first last" <, but not rfc2047 encoded. This patch makes sanitize_address stricter about what needs rfc2047 encoding and adds a test demonstrating where I noticed the problem. Signed-off-by: Jay Soffian <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'git-send-email.perl')
1 files changed, 2 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index fc153f9..6bbdfec 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -776,12 +776,13 @@ sub sanitize_address
# if recipient_name is already quoted, do nothing
- if ($recipient_name =~ /^(".*"|=\?utf-8\?q\?.*\?=)$/) {
+ if ($recipient_name =~ /^("[[:ascii:]]*"|=\?utf-8\?q\?.*\?=)$/) {
return $recipient;
# rfc2047 is needed if a non-ascii char is included
if ($recipient_name =~ /[^[:ascii:]]/) {
+ $recipient_name =~ s/^"(.*)"$/$1/;
$recipient_name = quote_rfc2047($recipient_name);