Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MX record lookups not counted according to RFC 7208 #25

Closed
dominics opened this issue Jan 9, 2018 · 0 comments
Closed

MX record lookups not counted according to RFC 7208 #25

dominics opened this issue Jan 9, 2018 · 0 comments

Comments

@dominics
Copy link

dominics commented Jan 9, 2018

RFC 7208 says:

When evaluating the "mx" mechanism, the number of "MX" resource records queried is included in the overall limit of 10 mechanisms/modifiers that cause DNS lookups as described above.

But countRequest() is only called once, when the MX records are looked up (but not for each record returned that causes an A lookup)

$this->DNSRecordGetter->countRequest();
$mxServers = $this->DNSRecordGetter->resolveMx($domain);
if (count($mxServers) > 10) {
return self::RESULT_PERMERROR;
}
foreach ($mxServers as $mxServer) {

There is a check that there isn't more than 10 MX records returned, which matches the following sentence in the RFC ("In addition to that limit, the evaluation of each "MX" record MUST NOT result inmquerying more than 10 address records"), but the lookup of an MX record seems to only count for one DNS request in total (as far as countRequest() goes).

An example of a SPF record that is accepted that should not be is something like:

v=spf1 mx include:foo.example.com include:bar.example.com

with nine MX records attached to the same domain (should be over the limit as defined in the RFC, as it causes 11 DNS lookups, but this library will only count 3 - before includes are evaluated further).

@dominics dominics changed the title MX record lookups not counted correctly MX record lookups not counted according to RFC 7208 Jan 9, 2018
@Mika56 Mika56 closed this as completed in 0989b3d Apr 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant