Skip to content

Always perform DNS lookup limit validation #56

@fernandomm

Description

@fernandomm

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',
                                                   'somerandomperson@example.com',
                                                   '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',
                                                   'somerandomperson@example.com',
                                                   '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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions