Include PTR types in SPF Builder (#378)

* Include PTR types in SPF

* Simplify PTR and Exists logic

* Include PTR test case

* Include PTR test case

* Remove extra }
This commit is contained in:
Kieran Jacobsen 2018-08-03 00:57:41 +10:00 committed by Craig Peterson
parent b0f86bc007
commit 95ebf1d35b
2 changed files with 2 additions and 1 deletions

View file

@ -82,7 +82,7 @@ func Parse(text string, dnsres Resolver) (*SPFRecord, error) {
return nil, errors.Errorf("In included spf: %s", err)
}
}
} else if strings.HasPrefix(part, "exists:") {
} else if strings.HasPrefix(part, "exists:") || strings.HasPrefix(part, "ptr:") {
p.IsLookup = true
} else {
return nil, errors.Errorf("Unsupported spf part %s", part)

View file

@ -21,6 +21,7 @@ func TestParse(t *testing.T) {
"include:sendgrid.net",
"include:spf.mtasv.net",
"exists:%{i}._spf.sparkpostmail.com",
"ptr:sparkpostmail.com",
"~all"}, " "), dnsres)
if err != nil {
t.Fatal(err)