author | Alberto Bertogli
<albertito@blitiri.com.ar> 2019-10-13 15:01:34 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2019-10-14 12:18:21 UTC |
parent | b567bf74824a681b76976a6467129da7e0760b44 |
spf.go | +3 | -4 |
spf_test.go | +1 | -1 |
diff --git a/spf.go b/spf.go index f4d45a1..bee90ba 100644 --- a/spf.go +++ b/spf.go @@ -16,10 +16,10 @@ // ip4 // ip6 // redirect +// exp (ignored) // // Not supported (return Neutral if used): // exists -// exp // Macros // // This is intentional and there are no plans to add them for now, as they are @@ -93,7 +93,6 @@ var ( errLookupLimitReached = fmt.Errorf("lookup limit reached") errMacrosNotSupported = fmt.Errorf("macros not supported") errExistsNotSupported = fmt.Errorf("'exists' not supported") - errExpNotSupported = fmt.Errorf("'exp' not supported") errUnknownField = fmt.Errorf("unknown field") errInvalidIP = fmt.Errorf("invalid ipX value") errInvalidMask = fmt.Errorf("invalid mask") @@ -244,8 +243,8 @@ func (r *resolution) Check(domain string) (Result, error) { trace("exists, neutral / not supported") return Neutral, errExistsNotSupported } else if strings.HasPrefix(field, "exp=") { - trace("exp=, neutral / not supported") - return Neutral, errExpNotSupported + trace("exp= not used, skipping") + continue } else if strings.HasPrefix(field, "redirect=") { trace("redirect, %q", field) // https://tools.ietf.org/html/rfc7208#section-6.1 diff --git a/spf_test.go b/spf_test.go index c5c482a..aa80a4b 100644 --- a/spf_test.go +++ b/spf_test.go @@ -26,6 +26,7 @@ func TestBasic(t *testing.T) { {"v=spf1 ", Neutral, nil}, {"v=spf1 -", PermError, errUnknownField}, {"v=spf1 all", Pass, errMatchedAll}, + {"v=spf1 exp=blah +all", Pass, errMatchedAll}, {"v=spf1 +all", Pass, errMatchedAll}, {"v=spf1 -all ", Fail, errMatchedAll}, {"v=spf1 ~all", SoftFail, errMatchedAll}, @@ -129,7 +130,6 @@ func TestNotSupported(t *testing.T) { err error }{ {"v=spf1 exists:blah -all", errExistsNotSupported}, - {"v=spf1 exp=blah -all", errExpNotSupported}, {"v=spf1 a:%{o} -all", errMacrosNotSupported}, {"v=spf1 redirect=_spf.%{d}", errMacrosNotSupported}, }