On 24.09.2008 12:59, Peter Haag wrote: > Indeed, there seem to be a bug. Here is the patch: > > --- NfAlert.pm.orig Wed Sep 24 12:57:47 2008 > +++ NfAlert.pm Wed Sep 24 12:56:35 2008 [...]
You probably should modify this once more. ;-)
TLDs can be longer than 4 digits. And more importantly, the foreach loop
checked the
wrong variable. If you have only one e-mail address you're fine either way, but
things should break if you specify more than one address:
--- snip ---
--- NfAlert.pm 2008-10-14 16:42:32 UTC (rev 3386)
+++ NfAlert.pm 2008-10-15 11:23:17 UTC (rev 3387)
@@ -1386,9 +1386,9 @@
$action_email =~ s/^\s+//;
$action_email =~ s/\s$//;
foreach my $email_addr ( split /\s*,\s*/, $action_email ) {
- if ( $action_email !~
/^([A-Z0-9]+[._]?){1,}[A-Z0-9]+\@(([A-Z0-9]+[-]?){1,}[A-Z0-9]+\.){1,}[A-Z]{2,4}$/i
) {
+ if ( $email_addr !~
/^([A-Z0-9]+[._]?){1,}[A-Z0-9\-]+\@(([A-Z0-9]+[-]?){1,}[A-Z0-9]+\.){1,}[A-Z]{2,6}$/i
) {
print $socket $EODATA;
- print $socket "ERR action_email '$action_email'
not a valid email address\n";
+ print $socket "ERR action_email '$email_addr'
not a valid email address\n";
return;
}
}
@@ -1771,7 +1771,7 @@
$action_email =~ s/^\s+//;
$action_email =~ s/\s$//;
foreach my $email_addr ( split /\s*,\s*/, $action_email ) {
- if ( $email_addr !~
/^([A-Z0-9]+[._]?){1,}[A-Z0-9]+\@(([A-Z0-9]+[-]?){1,}[A-Z0-9]+\.){1,}[A-Z]{2,4}$/i
) {
+ if ( $email_addr !~
/^([A-Z0-9]+[._]?){1,}[A-Z0-9\-]+\@(([A-Z0-9]+[-]?){1,}[A-Z0-9]+\.){1,}[A-Z]{2,6}$/i
) {
print $socket $EODATA;
print $socket "ERR action_email '$email_addr'
not a valid email address\n";
return;
--- snap ---
Regards -- Till
--
Dipl.-Inform. Till Dörges [EMAIL PROTECTED]
Senior Researcher Phone: +49 (0)700 / PRESECURE
PRESECURE Consulting GmbH, Münster AG Münster, HRB 6581
Geschäftsführer/Managing Director Dr. Klaus-Peter Kossakowski
CarmentiS - Early Warning Expertise
http://www.carmentis.org
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ Nfsen-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nfsen-discuss
