From cd371c114924377e13a7a0d809ce7459eafca4f7 Mon Sep 17 00:00:00 2001 From: Gert Van Gool Date: Fri, 8 Dec 2023 08:58:24 -0800 Subject: [PATCH] INWX: support MxNull records (#2700) Co-authored-by: Tom Limoncelli --- providers/inwx/auditrecords.go | 2 -- providers/inwx/inwxProvider.go | 12 ++++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/providers/inwx/auditrecords.go b/providers/inwx/auditrecords.go index fb15d2e71..64dff42e2 100644 --- a/providers/inwx/auditrecords.go +++ b/providers/inwx/auditrecords.go @@ -11,8 +11,6 @@ import ( func AuditRecords(records []*models.RecordConfig) []error { a := rejectif.Auditor{} - a.Add("MX", rejectif.MxNull) // Last verified 2020-12-28 - a.Add("SRV", rejectif.SrvHasNullTarget) // Last verified 2020-12-28 a.Add("TXT", rejectif.TxtHasBackticks) // Last verified 2021-03-01 diff --git a/providers/inwx/inwxProvider.go b/providers/inwx/inwxProvider.go index c511d85b6..f615d8082 100644 --- a/providers/inwx/inwxProvider.go +++ b/providers/inwx/inwxProvider.go @@ -180,7 +180,11 @@ func makeNameserverRecordRequest(domain string, rec *models.RecordConfig) *goinw req.Content = content[:len(content)-1] case "MX": req.Priority = int(rec.MxPreference) - req.Content = content[:len(content)-1] + if content == "." { + req.Content = content + } else { + req.Content = content[:len(content)-1] + } case "SRV": req.Priority = int(rec.SrvPriority) req.Content = fmt.Sprintf("%d %d %v", rec.SrvWeight, rec.SrvPort, content[:len(content)-1]) @@ -305,7 +309,11 @@ func (api *inwxAPI) GetZoneRecords(domain string, meta map[string]string) (model "PTR": true, } if rtypeAddDot[record.Type] { - record.Content = record.Content + "." + if record.Type == "MX" && record.Content == "." { + // null records don't need to be modified + } else { + record.Content = record.Content + "." + } } rc := &models.RecordConfig{