Subject: | Incorrect return value when domain is Address Literal |
Date: | Mon, 03 Aug 2009 16:02:19 +0000 |
To: | bug-Email-Valid [...] rt.cpan.org |
From: | "Koconis, David" <david.koconis [...] icsalabs.com> |
Distribution: Email-Valid-0.181
Perl version: v5.8.8
Operating System: CentOS 5.2 (kernel is
2.6.18-92.1.22.el5.centos.plus x86_64 SMP)
Problem:
The address method gives an incorrect return value for an address that
uses the address literal format described in section 4.1.3 of RFC 2821.
For example, the address 'david@[129.170.247.10]' returns undefined and
the address 'david@129.170.247.10' returns a value. According to the
RFC, the first form is valid and the second one is not.
FYI, my inelegant solution to this issue is to check if the domain
portion of the address is an IPv4 without brackets in the
_valid_domain_parts() subroutine just after checking if $string matches
".." and before splitting it. If it is an IP and no brackets are
present, then the subroutine returns.
David Koconis
Technical Lead, Network IPS & Anti-Spam Lab
ICSA Labs, An Independent Division of Verizon Business
david.koconis@icsalabs.com
717-790-8138 - Office