Git Product home page Git Product logo

Comments (6)

egulias avatar egulias commented on June 5, 2024

Hi @ValCanBuild
This is very tricky to fix. There is a thread in #301 about this.

from emailvalidator.

ValCanBuild avatar ValCanBuild commented on June 5, 2024

@egulias I don't quite understand how the two issues are connected. I believe this one mainly has to do with the DNSCheckValidation->checkDns function and how it only gets the last part of a host and not the whole thing.
Wouldn't it be possible to apply a fix there?

MX records should exist at the dns name equal to whatever is behind the @ in the email address. So only checking the parent domain is a bug. Source: https://www.nslookup.io/learning/dns-record-types/mx/#mx-records-below-the-zone-root

from emailvalidator.

ValCanBuild avatar ValCanBuild commented on June 5, 2024

@egulias I believe the issue might have been caused by this change: #355

There's a valid test case for this inside DNSCheckValidationTest but it's marked as skipped for some reason:
https://github.com/egulias/EmailValidator/blob/97c28cd611278a5686b7f8b47f4136472bebbe1f/tests/EmailValidator/Validation/DNSCheckValidationTest.php#LL97C33-L97C33

    public function testDNSWarnings()
    {
        $this->markTestSkipped('Need to found a domain with AAAA records and no MX that fails later in the validations');
        $validation = new DNSCheckValidation();
        $expectedWarnings = [NoDNSMXRecord::CODE => new NoDNSMXRecord()];
        $validation->isValid("[email protected]", new EmailLexer());
        $this->assertEquals($expectedWarnings, $validation->getWarnings());
    }

from emailvalidator.

ValCanBuild avatar ValCanBuild commented on June 5, 2024

@egulias just pinging again on this as I believe it's an open bug in 4.0.1 and above versions of the library.

from emailvalidator.

egulias avatar egulias commented on June 5, 2024

Hi @ValCanBuild
The reason is written in the skipping function
Need to found a domain with AAAA records and no MX that fails later in the validations
The thing is I haven't been able to actually test the code that does that type of validation because it looks like it either pass or fails at other points.
And also need a domain with AAAA and no MX.
I'm happy to review a PR with a proposed fix.

from emailvalidator.

ValCanBuild avatar ValCanBuild commented on June 5, 2024

@egulias here's a domain with AAAA records or no MX records you can use for the test: dnslookup.io
Proof: https://www.nslookup.io/domains/dnslookup.io/dns-records/

from emailvalidator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.