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: 22710
Status: resolved
Priority: 0/
Queue: Email-Valid

People
Owner: Nobody in particular
Requestors: davidp [...] preshweb.co.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.15
Fixed in: (no value)



Subject: Email::Valid accepts host parts starting or ending with hyphens
Email::Valid seems to accept email addresses where parts of the hostname begin or end with hyphens. I'm 99% sure that is not valid for any part of a domain name, and neither is more than one hyphen together, but I can't find a definitive reference for that... my Google-fu must be weak today. Examples which version 0.15 of Email::Valid accepts, which I feel it shouldn't: my @emails = qw( bob@-example.com bob@example-.com bob@-host.example.com bob@host-.example.com bob@double--dash.example.com ); Attached to this report is a simple test script which illustrates that the adddresses are accepted. Using: perl v5.8.7 built for i486-linux Any further info required, let me know. I could attempt to provide a patch if helpful. Many thanks David Precious
Subject: test_emailvalid.pl
#!/usr/bin/perl use Email::Valid; my @emails = qw( bob@-example.com bob@example-.com bob@-host.example.com bob@host-.example.com bob@double--dash.example.com ); for my $email (@emails) { if (Email::Valid->address($email)) { print "$email is valid!\n"; } }
Shall I provide a patch for this issue?
This is fixed and tested in 0.177 Please note, though, that internal double-dashes are allowed, as they are, well, allowed. There are a number of domains with -- in them, but all the ones I found were spammers, so I will not link them here. -- rjbs