Validate @recipients before using it for sendmail and Net::SMTP.
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 <robbat2@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
732263d411
commit
c38f0247a8
@ -449,6 +449,7 @@ sub send_message
|
|||||||
@cc = (map { sanitize_address_rfc822($_) } @cc);
|
@cc = (map { sanitize_address_rfc822($_) } @cc);
|
||||||
my $to = join (",\n\t", @recipients);
|
my $to = join (",\n\t", @recipients);
|
||||||
@recipients = unique_email_list(@recipients,@cc,@bcclist);
|
@recipients = unique_email_list(@recipients,@cc,@bcclist);
|
||||||
|
@recipients = (map { extract_valid_address($_) } @recipients);
|
||||||
my $date = format_2822_time($time++);
|
my $date = format_2822_time($time++);
|
||||||
my $gitversion = '@@GIT_VERSION@@';
|
my $gitversion = '@@GIT_VERSION@@';
|
||||||
if ($gitversion =~ m/..GIT_VERSION../) {
|
if ($gitversion =~ m/..GIT_VERSION../) {
|
||||||
@ -474,7 +475,7 @@ sub send_message
|
|||||||
$header .= join("\n", @xh) . "\n";
|
$header .= join("\n", @xh) . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
my @sendmail_parameters = ('-i', map { extract_valid_address($_) } @recipients);
|
my @sendmail_parameters = ('-i', @recipients);
|
||||||
|
|
||||||
if ($dry_run) {
|
if ($dry_run) {
|
||||||
# We don't want to send the email.
|
# We don't want to send the email.
|
||||||
|
Loading…
Reference in New Issue
Block a user