in reply to Email::Valid rejecting emails @example.com today

I personally wrote the patch that caused example.com to be invalid in accordance with the RFCs (in version 1.199, released on 2016-03-27, based on the Email::Valid Changes file).

Something changed at your end, whether it be an update to the distribution, or your DNS/naming infrastructure. Given that it happened across two separate environments separately, I suspect the latter (as you've stated within this thread).

jcb suggested to add a sub-domain to your domain for testing. If you go this route, ensure you create an MX record so your MX tests pass. You could also create a dummy example.com domain (with an MX) within your local infrastructure, or simply bypass the MX checks (unadvised).

Regardless... the reason this is failing is due to the fact that example.com is not a valid domain (technically it's a reserved domain; I say "invalid" for the purposes of the distribution).

Replies are listed 'Best First'.
Re^2: Email::Valid rejecting emails @example.com today
by Anonymous Monk on Sep 06, 2019 at 23:55 UTC

    I personally wrote the patch that caused example.com to be invalid in accordance with the RFCs

    Hi,

    Hmm, which rfc are you reading? I see what you did, it goeas against rfc6761.

    - treat restricted/reserved TLDs (invalid, test, example, loca +lhost) as invalid (thanks, Steve Bertrand!) # Purpose: Check whether a top level domain is valid for a domain. sub tld { my $self = shift; my %args = $self->_rearrange([qw( address )], \@_); unless (eval {require Net::Domain::TLD; Net::Domain::TLD->VERSION(1. +65); 1}) { die "Net::Domain::TLD not available"; } my $host = $self->_host( $args{address} or return $self->details('tl +d') ); my ($tld) = $host =~ m#\.(\w+)$#; my %invalid_tlds = map { $_ => 1 } qw(invalid test example localhost +); return defined $invalid_tlds{$tld} ? 0 : Net::Domain::TLD::tld_exist +s($tld); }

    Did you goof? https://tools.ietf.org/html/rfc6761 says

    2. Application software SHOULD NOT recognize example names as special and SHOULD use example names as they would other domain names.
      example.com is a second level domain, not a top level domain.
      The function you quoted deals with TLD, as in not.existing.example

      example.com seems to be treated as any other domain, which is by looking it up in DNS - which fails if there's no corresponding record

      :)

      I must have misunderstood.

        Maybe so , happens to everybody .... but does that help users of Email::Valid or not ?