send-email: a bit more careful domain regexp.

This tightens the regexp a bit to make sure there is no double dots.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2006-06-06 14:12:46 -07:00
parent ad9c18f504
commit 09302e177e

View File

@ -313,7 +313,7 @@ our ($message_id, $cc, %mail, $subject, $reply_to, $references, $message);
sub extract_valid_address {
my $address = shift;
my $local_part_regexp = '[^<>"\s@]+';
my $domain_regexp = '[^.<>"\s@]+\.[^<>"\s@]+';
my $domain_regexp = '[^.<>"\s@]+(?:\.[^.<>"\s@]+)+';
# check for a local address:
return $address if ($address =~ /^($local_part_regexp)$/);