also use "SRV 0 0 port ." in webadmin pages

for issue #240, thanks bwbroersma for reporting and patch
This commit is contained in:
Mechiel Lukkien 2024-11-10 22:17:15 +01:00
parent 355488028d
commit c13f1814fc
No known key found for this signature in database

View file

@ -1409,7 +1409,11 @@ When enabling MTA-STS, or updating a policy, always update the policy first (thr
r.SRVConf.SRVs = map[string][]net.SRV{} r.SRVConf.SRVs = map[string][]net.SRV{}
for _, req := range reqs { for _, req := range reqs {
name := req.name + "._tcp." + domain.ASCII name := req.name + "._tcp." + domain.ASCII
instr += fmt.Sprintf("\t%s._tcp.%-*s SRV 0 1 %d %s\n", req.name, len("_submissions")-len(req.name)+len(domain.ASCII+"."), domain.ASCII+".", req.port, req.host) weight := 1
if req.host == "." {
weight = 0
}
instr += fmt.Sprintf("\t%s._tcp.%-*s SRV 0 %d %d %s\n", req.name, len("_submissions")-len(req.name)+len(domain.ASCII+"."), domain.ASCII+".", weight, req.port, req.host)
r.SRVConf.SRVs[req.name] = unptr(req.srvs) r.SRVConf.SRVs[req.name] = unptr(req.srvs)
if err != nil { if err != nil {
addf(&r.SRVConf.Errors, "Looking up SRV record %q: %s", name, err) addf(&r.SRVConf.Errors, "Looking up SRV record %q: %s", name, err)