From c13f1814fc5ed64944b785fc3c532c4146d6df71 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Sun, 10 Nov 2024 22:17:15 +0100 Subject: [PATCH] also use "SRV 0 0 port ." in webadmin pages for issue #240, thanks bwbroersma for reporting and patch --- webadmin/admin.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webadmin/admin.go b/webadmin/admin.go index 8369cab..8d95698 100644 --- a/webadmin/admin.go +++ b/webadmin/admin.go @@ -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{} for _, req := range reqs { 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) if err != nil { addf(&r.SRVConf.Errors, "Looking up SRV record %q: %s", name, err)