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

Always perform DNS lookup limit validation #56

Open
fernandomm opened this issue Jan 10, 2024 · 0 comments
Open

Always perform DNS lookup limit validation #56

fernandomm opened this issue Jan 10, 2024 · 0 comments

Comments

@fernandomm
Copy link

I started using this gem but I'm having some issues related to the DNS lookup limit.

The validation error will happen depending on the mechanism order. If I have the following DNS zone with an SPF record that results in 11 DNS lookups:

example.com. IN 	A       2.2.2.2
example.com. IN 	TXT     "v=spf1 a:s1.h.example.com a:s2.h.example.com a:s3.h.example.com a:s4.h.example.com a:s5.h.example.com a:s6.h.example.com a:s7.h.example.com a:s8.h.example.com a:s9.h.example.com a:s1.h0.example.com a ~all"
*.h.example.com. IN A       1.1.1.1

This will work, because the IP 1.1.1.1 is found in "a:s1.h.example.com":

Coppertone::SpfService.authenticate_email('1.1.1.1',
                                                   '[email protected]',
                                                   'example.com')

But this one will fail because the IP 2.2.2.2 is only found in "a" mechanism and, at this point, it exceeds the number of allowed DNS lookups:

Coppertone::SpfService.authenticate_email('2.2.2.2',
                                                   '[email protected]',
                                                   'example.com')

Is it possible to force the DNS lookup validation to always run?

I tested several SMTP servers/antispam systems and it looks like this is the most common behavior.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant