Skip to content

Commit

Permalink
git-send-email: Don't set author_not_sender from Cc: lines
Browse files Browse the repository at this point in the history
When an mbox-style patch contains a Cc: line in the header,
git-send-email will check the address against the sender specified
on the command line. If they don't match, sender_not_author will
be set to the address obtained from the Cc line.

When this happens, git-send-email inserts a From: line at the
beginning of the message body with the address obtained from the
Cc line in the header, and the sender might be accused of forging
patch authors.

This patch fixes this by only updating sender_not_author when
processing From: lines, not when processing Cc: lines.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Haavard Skinnemoen authored and Junio C Hamano committed Aug 23, 2006
1 parent 44c1084 commit 68d42c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ sub send_message
if ($2 eq $from) {
next if ($suppress_from);
}
else {
elsif ($1 eq 'From') {
$author_not_sender = $2;
}
printf("(mbox) Adding cc: %s from line '%s'\n",
Expand Down

0 comments on commit 68d42c4

Please sign in to comment.