Skip to content

Commit ad308f6

Browse files
authoredFeb 17, 2025··
OVH: Bugfix: Native DMARC records rejected for subdomains (#3440)
1 parent 2c56f68 commit ad308f6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎providers/ovh/protocol.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package ovh
33
import (
44
"errors"
55
"fmt"
6+
"strings"
67

78
"github.com/StackExchange/dnscontrol/v4/models"
89
"github.com/miekg/dns/dnsutil"
@@ -184,9 +185,9 @@ func adaptNativeRecord(r *Record) error {
184185
// make sure target is fully unquoted to prevent "Invalid subfield found in DMARC" error
185186
r.Target = models.StripQuotes(r.Target)
186187
}
187-
// DMARC record can be created only for `_dmarc` subdomain
188-
if r.FieldType == "DMARC" && r.SubDomain != "_dmarc" {
189-
return fmt.Errorf("native OVH DMARC record requires subdomain to always be _dmarc, %s given", r.SubDomain)
188+
// DMARC record can be created only for subdomains starting with`_dmarc`
189+
if r.FieldType == "DMARC" && !strings.HasPrefix(r.SubDomain, "_dmarc") {
190+
return fmt.Errorf("native OVH DMARC record requires subdomain to always start with _dmarc, %s given", r.SubDomain)
190191
}
191192
return nil
192193
}

0 commit comments

Comments
 (0)
Please sign in to comment.