Handle RFC6652
All checks were successful
continuous-integration/drone/push Build is passing

Closes: https://framagit.org/happyDomain/happydeliver/-/issues/1
This commit is contained in:
nemunaire 2025-11-07 14:09:05 +07:00
commit deb9fd4f51
2 changed files with 31 additions and 2 deletions

View file

@ -122,6 +122,31 @@ func TestValidateSPF(t *testing.T) {
expectError: true,
errorMsg: "unknown modifier",
},
{
name: "Valid SPF with RFC 6652 ra modifier",
record: "v=spf1 mx ra=postmaster -all",
expectError: false,
},
{
name: "Valid SPF with RFC 6652 rp modifier",
record: "v=spf1 mx rp=100 -all",
expectError: false,
},
{
name: "Valid SPF with RFC 6652 rr modifier",
record: "v=spf1 mx rr=all -all",
expectError: false,
},
{
name: "Valid SPF with all RFC 6652 modifiers",
record: "v=spf1 mx ra=postmaster rp=50 rr=fail -all",
expectError: false,
},
{
name: "Valid SPF with RFC 6652 modifiers and redirect",
record: "v=spf1 ip4:192.0.2.0/24 ra=abuse redirect=_spf.example.com",
expectError: false,
},
}
analyzer := NewDNSAnalyzer(5 * time.Second)