send-email: allow multiple emails using --cc, --to and --bcc
[gitweb.git] / git-send-email.perl
index 7eec5f6db55564cefb0177d21d93f11edc2685ed..f4dbad3051e760f37d823c84884980c2c5978e35 100755 (executable)
@@ -460,20 +460,6 @@ sub read_config {
 ($repoauthor) = Git::ident_person(@repo, 'author');
 ($repocommitter) = Git::ident_person(@repo, 'committer');
 
-# Verify the user input
-
-foreach my $entry (@initial_to) {
-       die "Comma in --to entry: $entry'\n" unless $entry !~ m/,/;
-}
-
-foreach my $entry (@initial_cc) {
-       die "Comma in --cc entry: $entry'\n" unless $entry !~ m/,/;
-}
-
-foreach my $entry (@bcclist) {
-       die "Comma in --bcclist entry: $entry'\n" unless $entry !~ m/,/;
-}
-
 sub parse_address_line {
        if ($have_mail_address) {
                return map { $_->format } Mail::Address->parse($_[0]);
@@ -1026,7 +1012,8 @@ sub sanitize_address_list {
 }
 
 sub process_address_list {
-       my @addr_list = expand_aliases(@_);
+       my @addr_list = map { parse_address_line($_) } @_;
+       @addr_list = expand_aliases(@addr_list);
        @addr_list = sanitize_address_list(@addr_list);
        @addr_list = validate_address_list(@addr_list);
        return @addr_list;