Hello community, here is the log from the commit of package perl-Email-Valid for openSUSE:Factory checked in at 2012-02-27 18:34:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Email-Valid (Old) and /work/SRC/openSUSE:Factory/.perl-Email-Valid.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Email-Valid", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Email-Valid/perl-Email-Valid.changes 2011-12-06 16:24:04.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Email-Valid.new/perl-Email-Valid.changes 2012-02-27 18:35:43.000000000 +0100 @@ -1,0 +2,17 @@ +Mon Feb 27 10:06:49 UTC 2012 - [email protected] + +- updated to 0.187 + addresses in the form rjbs@[1.2.3.4] are now (correctly) considered + valid; this can be disabled with the -allow_ip option + (this resolves RT#48398) + + check email address length and localpart length (thanks, Steve + Bertrand!) + + use blessed($x) instead of wrapping an ->isa called in eval{}; this + patch (thanks, Felipe Bergo!) was submitted to avoid problems with + people who have global __DIE__ handlers, but was applied to just + avoid the dumb eval{}; people with __DIE__ are otherwise on their + own, here + +------------------------------------------------------------------- Old: ---- Email-Valid-0.185.tar.gz New: ---- Email-Valid-0.187.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Email-Valid.spec ++++++ --- /var/tmp/diff_new_pack.0y7UwK/_old 2012-02-27 18:35:44.000000000 +0100 +++ /var/tmp/diff_new_pack.0y7UwK/_new 2012-02-27 18:35:44.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package perl-Email-Valid # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,26 +15,27 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + Name: perl-Email-Valid -Version: 0.185 +Version: 0.187 Release: 0 -License: Artistic-1.0 or GPL-1.0+ %define cpan_name Email-Valid Summary: Check validity of Internet email addresses -Url: http://search.cpan.org/dist/Email-Valid/ +License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl +Url: http://search.cpan.org/dist/Email-Valid/ Source: http://www.cpan.org/authors/id/R/RJ/RJBS/%{cpan_name}-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl -BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: perl-macros BuildRequires: perl(Mail::Address) BuildRequires: perl(Net::DNS) -BuildRequires: perl(Test::More) -BuildRequires: perl-macros +#BuildRequires: perl(Email::Valid) +#BuildRequires: perl(IO::CaptureOutput) +#BuildRequires: perl(Net::Domain::TLD) Requires: perl(Mail::Address) Requires: perl(Net::DNS) -Requires: perl(Test::More) %{perl_requires} %description @@ -52,16 +53,13 @@ %{__make} %{?_smp_mflags} %check -#broken test suite %{__make} test +#broken %{__make} test %install %perl_make_install %perl_process_packlist %perl_gen_filelist -%clean -%{__rm} -rf %{buildroot} - %files -f %{name}.files %defattr(-,root,root,755) %doc Changes LICENSE README ++++++ Email-Valid-0.185.tar.gz -> Email-Valid-0.187.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Email-Valid-0.185/Changes new/Email-Valid-0.187/Changes --- old/Email-Valid-0.185/Changes 2011-08-11 19:25:29.000000000 +0200 +++ new/Email-Valid-0.187/Changes 2012-01-27 17:23:47.000000000 +0100 @@ -1,5 +1,20 @@ Revision history for Perl extension Email::Valid. +0.187 2012-01-27 + addresses in the form rjbs@[1.2.3.4] are now (correctly) considered + valid; this can be disabled with the -allow_ip option + (this resolves RT #48398) + + check email address length and localpart length (thanks, Steve + Bertrand!) + +0.186 2012-01-22 + use blessed($x) instead of wrapping an ->isa called in eval{}; this + patch (thanks, Felipe Bergo!) was submitted to avoid problems with + people who have global __DIE__ handlers, but was applied to just + avoid the dumb eval{}; people with __DIE__ are otherwise on their + own, here + 0.185 2011-08-11 do not die in t/valid.t when testing for working DNS (address RT #70157, thanks, Alexey Tourbin) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Email-Valid-0.185/META.json new/Email-Valid-0.187/META.json --- old/Email-Valid-0.185/META.json 2011-08-11 19:40:41.000000000 +0200 +++ new/Email-Valid-0.187/META.json 2012-01-27 17:28:09.000000000 +0100 @@ -4,7 +4,7 @@ "unknown" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 6.59, CPAN::Meta::Converter version 2.112150", + "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.113640", "license" : [ "perl_5" ], @@ -34,6 +34,7 @@ "requires" : { "Mail::Address" : 0, "Net::DNS" : 0, + "Scalar::Util" : 0, "Test::More" : 0, "perl" : "5.006" } @@ -45,5 +46,5 @@ "url" : "http://github.com/rjbs/email-valid" } }, - "version" : "0.185" + "version" : "0.187" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Email-Valid-0.185/META.yml new/Email-Valid-0.187/META.yml --- old/Email-Valid-0.185/META.yml 2011-08-11 19:40:41.000000000 +0200 +++ new/Email-Valid-0.187/META.yml 2012-01-27 17:28:08.000000000 +0100 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: 0 dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 6.59, CPAN::Meta::Converter version 2.112150' +generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.113640' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -20,8 +20,9 @@ requires: Mail::Address: 0 Net::DNS: 0 + Scalar::Util: 0 Test::More: 0 perl: 5.006 resources: repository: http://github.com/rjbs/email-valid -version: 0.185 +version: 0.187 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Email-Valid-0.185/Makefile.PL new/Email-Valid-0.187/Makefile.PL --- old/Email-Valid-0.185/Makefile.PL 2010-01-27 17:51:54.000000000 +0100 +++ new/Email-Valid-0.187/Makefile.PL 2012-01-22 17:12:14.000000000 +0100 @@ -22,12 +22,13 @@ WriteMakefile( 'NAME' => 'Email::Valid', - 'VERSION_FROM' => 'lib/Email/Valid.pm', + 'VERSION_FROM' => 'lib/Email/Valid.pm', MIN_PERL_VERSION => '5.006', (eval { ExtUtils::MakeMaker->VERSION(6.21) } ? (LICENSE => 'perl') : ()), 'PREREQ_PM' => { 'Test::More' => 0, 'Mail::Address' => 0, + 'Scalar::Util' => 0, # for blessed() ($need_net_dns ? ('Net::DNS' => 0) : ()), ((!$need_net_dns and $^O =~ /\AMSWin32|Cygwin\z/) ? ('IO::CaptureOutput' => 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Email-Valid-0.185/lib/Email/Valid.pm new/Email-Valid-0.187/lib/Email/Valid.pm --- old/Email-Valid-0.185/lib/Email/Valid.pm 2011-08-11 19:36:58.000000000 +0200 +++ new/Email-Valid-0.187/lib/Email/Valid.pm 2012-01-27 17:27:00.000000000 +0100 @@ -10,10 +10,11 @@ use IO::File; use Mail::Address; use File::Spec; +use Scalar::Util 'blessed'; use bytes; -$VERSION = '0.185'; +$VERSION = '0.187'; %AUTOLOAD = ( fqdn => 1, @@ -21,6 +22,7 @@ mxcheck => 1, tldcheck => 1, local_rules => 1, + localpart => 1, ); $NSLOOKUP_PAT = 'preference|serial|expire|mail\s+exchanger'; @@ -56,7 +58,9 @@ $self->{tldcheck} = 0; $self->{fudge} = 0; $self->{fqdn} = 1; + $self->{allow_ip} = 1; $self->{local_rules} = 0; + $self->{localpart} = 1; $self->{details} = $Details = undef; } @@ -102,7 +106,7 @@ my %args = $self->_rearrange([qw( address )], \@_); my $addr = $args{address} or return $self->details('rfc822'); - $addr = $addr->address if eval { $addr->isa('Mail::Address') }; + $addr = $addr->address if (blessed($addr) && $addr->isa('Mail::Address')); return $self->details('rfc822') if $addr =~ /\P{ASCII}/ or $addr !~ m/^$RFC822PAT$/o; @@ -234,7 +238,7 @@ my $self = shift; my $addr = shift; - $addr = $addr->address if eval { $addr->isa('Mail::Address') }; + $addr = $addr->address if (blessed($addr) && $addr->isa('Mail::Address')); my $host = ($addr =~ /^.*@(.*)$/ ? $1 : $addr); $host =~ s/\s+//g; @@ -279,6 +283,14 @@ 1; } +sub _valid_local_part { + my ($self, $localpart) = @_; + + return 0 unless $localpart and length $localpart <= 64; + + return 1; +} + sub _valid_domain_parts { my ($self, $string) = @_; @@ -312,7 +324,7 @@ local_rules )], \@_); my $addr = $args{address} or return $self->details('rfc822'); - $addr = $addr->address if eval { $addr->isa('Mail::Address') }; + $addr = $addr->address if (blessed($addr) && $addr->isa('Mail::Address')); $addr = $self->_fudge( $addr ) if $args{fudge}; $self->rfc822( -address => $addr ) or return undef; @@ -321,15 +333,29 @@ $addr or return $self->details('rfc822'); # This should never happen + if (length($addr->address) > 254) { + return $self->details('address_too_long'); + } + if ($args{local_rules}) { $self->_local_rules( $addr->user, $addr->host ) or return $self->details('local_rules'); } - if ($args{fqdn}) { - no warnings 'uninitialized'; # valid domain parts might return undef - $self->_valid_domain_parts($addr->host) > 1 - or return $self->details('fqdn'); + if ($args{localpart}) { + $self->_valid_local_part($addr->user) > 0 + or return $self->details('localpart'); + } + + my $ip_ok = $args{allow_ip} && $addr->host =~ /\A\[ + (?:[0-9]{1,3}\.){3}[0-9]{1,3} + /x; + + if (! $ip_ok && $args{fqdn}) { + my $domain_parts = $self->_valid_domain_parts($addr->host); + + return $self->details('fqdn') + unless $ip_ok || ($domain_parts && $domain_parts > 1); } if ($args{tldcheck}) { @@ -510,6 +536,7 @@ -tldcheck -fudge -fqdn + -allow_ip -local_rules =item mx ( <ADDRESS>|<DOMAIN> ) @@ -544,11 +571,25 @@ spaces in AOL addresses, and the conversion of commas to periods in Compuserve addresses. The default is false. +=item allow_ip ( <TRUE>|<FALSE> ) + +Specifies whether a "domain literal" is acceptable as the domain part. That +means addresses like: C<rjbs@[1.2.3.4]> + +The checking for the domain literal is stricter than the RFC and looser than +checking for a valid IP address, I<but this is subject to change>. + +The default is true. + =item fqdn ( <TRUE>|<FALSE> ) Species whether addresses passed to address() must contain a fully qualified domain name (FQDN). The default is true. +B<Please note!> FQDN checks only occur for non-domain-literals. In other +words, if you have set C<allow_ip> and the address ends in a bracketed IP +address, the FQDN check will not occur. + =item local_rules ( <TRUE>|<FALSE> ) Specifies whether addresses passed to address() should be tested @@ -581,6 +622,7 @@ method to determine why it failed. Possible values are: rfc822 + localpart local_rules fqdn mxcheck diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Email-Valid-0.185/t/pod-coverage.t new/Email-Valid-0.187/t/pod-coverage.t --- old/Email-Valid-0.185/t/pod-coverage.t 2008-11-21 22:36:54.000000000 +0100 +++ new/Email-Valid-0.187/t/pod-coverage.t 2012-01-27 17:22:34.000000000 +0100 @@ -1,4 +1,4 @@ -#!perl -T +#!perl use Test::More; eval "use Test::Pod::Coverage 1.08"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Email-Valid-0.185/t/resolver.t new/Email-Valid-0.187/t/resolver.t --- old/Email-Valid-0.185/t/resolver.t 2010-06-11 04:05:46.000000000 +0200 +++ new/Email-Valid-0.187/t/resolver.t 2012-01-27 17:21:47.000000000 +0100 @@ -1,5 +1,4 @@ -#!perl -T - +#!perl use strict; use Test::More; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Email-Valid-0.185/t/valid.t new/Email-Valid-0.187/t/valid.t --- old/Email-Valid-0.185/t/valid.t 2011-08-11 19:27:45.000000000 +0200 +++ new/Email-Valid-0.187/t/valid.t 2012-01-27 17:27:27.000000000 +0100 @@ -1,7 +1,7 @@ #!perl use strict; -use Test::More tests => 22; +use Test::More tests => 31; BEGIN { use_ok('Email::Valid'); @@ -9,15 +9,20 @@ my $v = Email::Valid->new; -ok( - ! $v->address('Alfred Neuman <Neuman@BBN-TENEXA>'), - 'Alfred Neuman <Neuman@BBN-TENEXA>', -); +for my $sub ( + sub { $_[0] }, + sub { Mail::Address->new(undef, $_[0]) }, +) { + ok( + ! $v->address( $sub->('Alfred Neuman <Neuman@BBN-TENEXA>') ), + 'Alfred Neuman <Neuman@BBN-TENEXA>', + ); -ok( - $v->address('[email protected]'), - '[email protected]', -); + ok( + $v->address( $sub->('[email protected]') ), + '[email protected]', + ); +} ok( $v->address( -address => 'Alfred Neuman <Neuman@BBN-TENEXA>', -fqdn => 0), @@ -49,6 +54,27 @@ "comments nicely dropped from an address", ); +is ($v->address(-address => 'user@example.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), + undef, + "address with > 254 chars fails", +); + +is($v->details, 'address_too_long', "details say address is too long"); + +is( + $v->address(-address => '[email protected]', -localpart => 1), + '[email protected]', + "localpart with 64 chars or less is valid", +); + +is( + $v->address(-address => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...@example.com', -localpart => 1), + undef, + "localpart with 64 chars or more fails", +); + +is($v->details, 'localpart', "details are localpart"); + ok( $v->address('somebody@ example.com'), "space between @ and domain is valid", @@ -110,6 +136,16 @@ ) or diag "was using $Email::Valid::DNS_Method for dns resolution"; } +ok( + $v->address(-address => 'rjbs@[127.0.0.1]'), + 'a domain literal address is okay', +); + +ok( + ! $v->address(-address => 'rjbs@[127.0.0.1]', -allow_ip => 0), + 'a domain literal address is not okay if we say -allow_ip=>0', +); + SKIP: { skip "tests require Net::Domain::TLD 1.65", 3 unless (eval {require Net::Domain::TLD;Net::Domain::TLD->VERSION(1.65);1}); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
