mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-11-10 17:26:10 +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)
|
||||
}
|
||||
}
|
||||
} 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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue