#736: dmarc evalute added check if fromDomain is a TLD

This commit is contained in:
Matthias Schneider 2024-12-09 09:03:45 +01:00
parent 5bb56e3777
commit 72416b0456

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