mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-12-09 21:55:57 +08:00
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:
parent
b0f86bc007
commit
95ebf1d35b
2 changed files with 2 additions and 1 deletions
|
|
@ -82,7 +82,7 @@ func Parse(text string, dnsres Resolver) (*SPFRecord, error) {
|
||||||
return nil, errors.Errorf("In included spf: %s", err)
|
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
|
p.IsLookup = true
|
||||||
} else {
|
} else {
|
||||||
return nil, errors.Errorf("Unsupported spf part %s", part)
|
return nil, errors.Errorf("Unsupported spf part %s", part)
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ func TestParse(t *testing.T) {
|
||||||
"include:sendgrid.net",
|
"include:sendgrid.net",
|
||||||
"include:spf.mtasv.net",
|
"include:spf.mtasv.net",
|
||||||
"exists:%{i}._spf.sparkpostmail.com",
|
"exists:%{i}._spf.sparkpostmail.com",
|
||||||
|
"ptr:sparkpostmail.com",
|
||||||
"~all"}, " "), dnsres)
|
"~all"}, " "), dnsres)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue