Merge pull request #737 from mschneider82/master

#736: dmarc evalute added check if fromDomain is a TLD
This commit is contained in:
Max Mazurov 2025-01-24 16:52:23 +03:00 committed by GitHub
commit fd40288271
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -207,6 +207,10 @@ func isAligned(fromDomain, authDomain string, mode AlignmentMode) bool {
return strings.EqualFold(fromDomain, authDomain)
}
tld, _ := publicsuffix.PublicSuffix(fromDomain)
if strings.EqualFold(fromDomain, tld) {
return strings.EqualFold(fromDomain, authDomain)
}
orgDomainFrom, err := publicsuffix.EffectiveTLDPlusOne(fromDomain)
if err != nil {
return false