Validate @recipients before using it for sendmail and Net::SMTP.
[gitweb.git] / git-send-email.perl
index e4fe8965bbb305bcf569d354d3d8cc4f9fc084a3..b6022929042e0b03f395c553e93c6f47a35c6990 100755 (executable)
@@ -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../) {
@@ -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.