File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package ovh
3
3
import (
4
4
"errors"
5
5
"fmt"
6
+ "strings"
6
7
7
8
"github.com/StackExchange/dnscontrol/v4/models"
8
9
"github.com/miekg/dns/dnsutil"
@@ -184,9 +185,9 @@ func adaptNativeRecord(r *Record) error {
184
185
// make sure target is fully unquoted to prevent "Invalid subfield found in DMARC" error
185
186
r .Target = models .StripQuotes (r .Target )
186
187
}
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 )
190
191
}
191
192
return nil
192
193
}
You can’t perform that action at this time.
0 commit comments