File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -1259,6 +1259,7 @@ sub send_message {
12591259 open my $fh , " <" , $t or die " can't open file $t " ;
12601260
12611261 my $author = undef ;
1262+ my $sauthor = undef ;
12621263 my $author_encoding ;
12631264 my $has_content_type ;
12641265 my $body_encoding ;
@@ -1297,7 +1298,7 @@ sub send_message {
12971298 }
12981299 elsif (/ ^From:\s +(.*)$ /i ) {
12991300 ($author , $author_encoding ) = unquote_rfc2047($1 );
1300- my $sauthor = sanitize_address($author );
1301+ $sauthor = sanitize_address($author );
13011302 next if $suppress_cc {' author' };
13021303 next if $suppress_cc {' self' } and $sauthor eq $sender ;
13031304 printf (" (mbox) Adding cc: %s from line '%s '\n " ,
@@ -1393,7 +1394,7 @@ sub send_message {
13931394 $subject = quote_subject($subject , $auto_8bit_encoding );
13941395 }
13951396
1396- if (defined $author and $author ne $sender ) {
1397+ if (defined $sauthor and $sauthor ne $sender ) {
13971398 $message = " From: $author \n\n $message " ;
13981399 if (defined $author_encoding ) {
13991400 if ($has_content_type ) {
Original file line number Diff line number Diff line change @@ -956,6 +956,20 @@ test_expect_success $PREREQ 'utf8 author is correctly passed on' '
956956 grep "^From: Füñný Nâmé <odd_?=mail@example.com>" msgtxt1
957957'
958958
959+ test_expect_success $PREREQ ' utf8 sender is not duplicated' '
960+ clean_fake_sendmail &&
961+ test_commit weird_sender &&
962+ test_when_finished "git reset --hard HEAD^" &&
963+ git commit --amend --author "Füñný Nâmé <odd_?=mail@example.com>" &&
964+ git format-patch --stdout -1 >funny_name.patch &&
965+ git send-email --from="Füñný Nâmé <odd_?=mail@example.com>" \
966+ --to=nobody@example.com \
967+ --smtp-server="$(pwd)/fake.sendmail" \
968+ funny_name.patch &&
969+ grep "^From: " msgtxt1 >msgfrom &&
970+ test_line_count = 1 msgfrom
971+ '
972+
959973test_expect_success $PREREQ ' sendemail.composeencoding works' '
960974 clean_fake_sendmail &&
961975 git config sendemail.composeencoding iso-8859-1 &&
You can’t perform that action at this time.
0 commit comments