Subject: | mail check too strict, pt.2 |
Date: | Mon, 13 Jul 2009 13:24:45 +0200 (CEST) |
To: | bug-Mail-SendEasy [...] rt.cpan.org |
From: | "Darko Prelec" <dprelec [...] oglasnik.hr> |
Hi!
Machine info:
- Perl version is 5.8.8
- GNU/Linux 2.6.18-6-amd64
- OS: Debian 4.0
- module_info Mail::SendEasy
Name: Mail::SendEasy
Version: 1.2
Directory: /usr/local/share/perl/5.8.8
File: /usr/local/share/perl/5.8.8/Mail/SendEasy.pm
Core module: no
Description:
Version 1.2 of Mail::SendEasy Perl module has another simple bug in email
check routine. It reports valid email addresses as "Invalid recipient".
Fix:
The bug can be located on the line 450 in the Mail/SendEasy.pm file,
subroutine _format(), and here's the patch:
--- SendEasy.pm 2009-07-13 13:19:39.000000000 +0200
+++ SendEasy.pm.fixed 2009-07-13 13:16:14.000000000 +0200
@@ -447,7 +447,7 @@
my $stat = 1 ;
if ($mail !~ /^[\w\.-]+\@localhost$/gsi) {
- if ($mail !~ /^[\w\.-]+\@(?:[\w-]+\.)*?(?:\w+(?:-\w+)*)(?:\.\w+)+$/ )
{ $stat = undef ;}
+ if ($mail !~
/^[\w\.-]+\@(?:[\w-]+\.)*?(?:\w+(?:[\w-]+)*)(?:\.\w+)+$/) { $stat = undef
;}
}
elsif ($mail !~ /^[\w\.-]+\@[\w-]+$/ ) { $stat = undef ;}