1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

SPF Flatten for non apex domains (#1220)

This commit is contained in:
Vincent Hagen
2021-07-25 17:53:31 +02:00
committed by GitHub
parent f63302b978
commit 243762d171
2 changed files with 12 additions and 2 deletions

View File

@@ -15,9 +15,9 @@ func flattenSPFs(cfg *models.DNSConfig) []error {
var errs []error
var err error
for _, domain := range cfg.Domains {
apexTXTs := domain.Records.GroupedByKey()[models.RecordKey{Type: "TXT", NameFQDN: domain.Name}]
txtRecords := domain.Records.GetByType("TXT")
// flatten all spf records that have the "flatten" metadata
for _, txt := range apexTXTs {
for _, txt := range txtRecords {
var rec *spflib.SPFRecord
txtTarget := strings.Join(txt.TxtStrings, "")
if txt.Metadata["flatten"] != "" || txt.Metadata["split"] != "" {