in domain/dns self-check, for unexpected SRV records for "srv autoconfig", show the values of the unexpected records

should be more helpful in understanding what's wrong.

feedback from mteege, thanks!
This commit is contained in:
Mechiel Lukkien 2025-02-16 16:21:01 +01:00
parent 6f678125a5
commit 3d0dc3a79d
No known key found for this signature in database

View File

@ -1445,7 +1445,11 @@ When enabling MTA-STS, or updating a policy, always update the policy first (thr
addf(&r.SRVConf.Errors, "Missing SRV record %q", name)
}
} else if len(req.srvs) != 1 || req.srvs[0].Target != req.host || req.srvs[0].Port != req.port {
addf(&r.SRVConf.Errors, "Unexpected SRV record(s) for %q", name)
var srvs []string
for _, srv := range req.srvs {
srvs = append(srvs, fmt.Sprintf("%d %d %d %s", srv.Priority, srv.Weight, srv.Port, srv.Target))
}
addf(&r.SRVConf.Errors, "Unexpected SRV record(s) for %q: %s", name, strings.Join(srvs, ", "))
}
}
addf(&r.SRVConf.Instructions, instr)