mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00: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:
committed by
Craig Peterson
parent
b0f86bc007
commit
95ebf1d35b
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user