mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-02-24 15:43:08 +08:00
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:
parent
7c1f45b002
commit
f77f202b65
2 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue