Skip to content

Commit 8470260

Browse files
authored
BUGFIX: fix regression on a mechanism parts (#3994)
819253a seems to have caused a regression in the parsing of `a` mechanism SPF parts, e.g. a part like `a:something.wm.edu` would now return `ERROR: unsupported SPF part a:something.wm.edu`. This reverts back to the use `HasPrefix` to prevent those parts from erroring. Parsing this way wouldn't error on bad parts like `asdf:something.wm.edu`, so maybe a larger fix is needed, but for now just fixing the regression seemed simplest.
1 parent 32f3d3e commit 8470260

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/spflib/parse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func Parse(text string, dnsres Resolver) (*SPFRecord, error) {
6161
if part == "all" {
6262
// all. nothing else matters.
6363
break
64-
} else if lcpart == "a" || lcpart == "mx" {
64+
} else if strings.HasPrefix(lcpart, "a") || strings.HasPrefix(lcpart, "mx") {
6565
p.IsLookup = true
6666
} else if strings.HasPrefix(lcpart, "ip4:") || strings.HasPrefix(lcpart, "ip6:") {
6767
// ip address, 0 lookups

0 commit comments

Comments
 (0)