Skip to content

Commit

Permalink
Validate @recipients before using it for sendmail and Net::SMTP.
Browse files Browse the repository at this point in the history
Ensure that @recipients is only raw addresses when it is handed to the sendmail
binary OR Net::SMTP, otherwise BCC cases might get an extra <, or wierd stuff
might be passed to the exec.

Signed-off-by: Robin H. Johnson <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
robbat2 authored and Junio C Hamano committed Apr 26, 2007
1 parent 732263d commit c38f024
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ sub send_message
@cc = (map { sanitize_address_rfc822($_) } @cc);
my $to = join (",\n\t", @recipients);
@recipients = unique_email_list(@recipients,@cc,@bcclist);
@recipients = (map { extract_valid_address($_) } @recipients);
my $date = format_2822_time($time++);
my $gitversion = '@@GIT_VERSION@@';
if ($gitversion =~ m/..GIT_VERSION../) {
Expand All @@ -474,7 +475,7 @@ sub send_message
$header .= join("\n", @xh) . "\n";
}

my @sendmail_parameters = ('-i', map { extract_valid_address($_) } @recipients);
my @sendmail_parameters = ('-i', @recipients);

if ($dry_run) {
# We don't want to send the email.
Expand Down

0 comments on commit c38f024

Please sign in to comment.