Add support for "exists" element in SPF. (#356)

* Include support for "exists" element in SPF.
* Add exists: SPF entry to test support
This commit is contained in:
Kieran Jacobsen 2018-05-03 22:54:19 +10:00 committed by Tom Limoncelli
parent 7c1f45b002
commit f77f202b65
2 changed files with 3 additions and 0 deletions

View file

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

View file

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