Skip to content

Commit

Permalink
foxcpp#736: dmarc evalute added check if fromDomain is a TLD
Browse files Browse the repository at this point in the history
  • Loading branch information
mschneider82 committed Dec 9, 2024
1 parent 5bb56e3 commit 72416b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/dmarc/evaluate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 72416b0

Please sign in to comment.