danielsen / NetSPF

.NET SPF tools
MIT License
2 stars 3 forks source link

Returns PermanentError on invalid include #2

Open kristho91 opened 2 years ago

kristho91 commented 2 years ago
SpfResolver.CheckHost(
    address: IPAddress.Parse("1.1.1.1"),
    domainName: "domain.com",
    sender: "bob@domain.com",
    heloDomain: "domain.com",
    hostDomain: "other.com");

SPF for domain.com: v=spf1 include:a.com ipv4:1.1.1.1 -all

SPF for a.com: NONE

This example will return PermanentError, because a.com is invalid - but the email I'm checking is valid, due to ipv4:1.1.1.1 coming after.

But if the SPF for domain.com was: v=spf1 ipv4:1.1.1.1 include:a.com -all

It would work fine. The order of the items in SPF record should not matter :)

danielsen commented 2 years ago

Thanks for the report. I'll check it out.