Merge branch 'jc/cache-tree' into next
[gitweb.git] / git-send-email.perl
index 0540e93758e45a03ad87272b0ceed9acb8973f53..312a4ea2aa10189eeb470a185993bb7f8af45d0e 100755 (executable)
@@ -307,6 +307,10 @@ sub expand_aliases {
 
 sub extract_valid_address {
        my $address = shift;
+
+       # check for a local address:
+       return $address if ($address =~ /^([\w\-]+)$/);
+
        if ($have_email_valid) {
                return Email::Valid->address($address);
        } else {
@@ -498,9 +502,14 @@ (@)
        my @emails;
 
        foreach my $entry (@_) {
-               my $clean = extract_valid_address($entry);
-               next if $seen{$clean}++;
-               push @emails, $entry;
+               if (my $clean = extract_valid_address($entry)) {
+                       $seen{$clean} ||= 0;
+                       next if $seen{$clean}++;
+                       push @emails, $entry;
+               } else {
+                       print STDERR "W: unable to extract a valid address",
+                                       " from: $entry\n";
+               }
        }
        return @emails;
 }