Perl-Email-Project / Email-Valid

perl library to validate email addresses
19 stars 19 forks source link

Email Address with underscores are considered invalid #48

Closed edmundadjei closed 2 years ago

edmundadjei commented 5 years ago

email addresses with underscores are valid, but they are rejected by Email::Valid->address

code snippet

#!/usr/bin/env perl

use Email::Valid;
use feature 'say';

say Email::Valid->address( -address => $ARGV[0], -mxcheck => 1,)
    ? $ARGV[0] . " is valid"
    : $ARGV[0] . " is NOT valid";

eadjei@UX-009:~ $ ./mx.pl e.adjei@lloydsbg-workday.aplitrak.com e.adjei@lloydsbg-workday.aplitrak.com is valid eadjei@UX-009:~ $ ./mx.pl e.adjei@lloydsbg_workday.aplitrak.com e.adjei@lloydsbg_workday.aplitrak.com is NOT valid eadjei@UX-009:~ $

yahermann commented 4 years ago

While underscores are allowed within name, they're not valid within domain name. This is correct per standards, and therefore module works correctly.

e-adjei@lloydsbg-workday.aplitrak.com is valid e_adjei@lloydsbg-workday.aplitrak.com is valid

edmundadjei commented 2 years ago

I really should have checked the RFC first, my bad. Thanks, yahermann