Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Email-Valid CPAN distribution.

Report information
The Basics
Id: 395
Status: resolved
Priority: 0/
Queue: Email-Valid

People
Owner: Nobody in particular
Requestors: mitch [...] icserv.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Incorrect Validation of Email Address
Redhat 6.2/7.2 Kernel 2.4.9-21/2.2.14-5 Intel i686/i686 Perl 5.005_03/5.6.0 This was tested on two machines The problem I found is that when executing the command: Email::Valid->address($address) returns true when $address = 'whatever@whatever.com{' or 'whatever@whatever.com}' or 'whatever@whatever.com*' or 'whatever@whatever.com$' or 'whatever@whatever.com#' That is all that I tested, but I don't think that those addresses should return true. Mitch Freed ICServ Inc. mitch@icserv.net
From: m_rt.cpan.org_20020702 [...] wickline.org
Show quoted text
> Email::Valid->address($address) > > returns true when $address = > 'whatever@whatever.com{' or > 'whatever@whatever.com}' or > 'whatever@whatever.com*' or > 'whatever@whatever.com$' or > 'whatever@whatever.com#'
This is actually a documented feature. In the Email::Valid documentation for version 0.13, the address method's documentation includes: Show quoted text
> If the address passes all checks, the > (possibly modified) address is returned
^^^^^^^^^^^^^^^^^^^ In the source of the module, line 233 calls Mail::Address->parse which will attempt to parse a valid address out of somet text (for example, a To: mail header). So, if you pass it the above bad addresses, it's probably giving you a true return value which is *just* the address without the extra garbage character. Returning true is the expected behavior for those bad addresses. You just need to be sure to assign return value to somewhere so that you can use the cleaned up version of the address. See the examples section of the documentation in Email::Valid for more information. -matt