Skip to content

Commit

Permalink
Update SpfCheck.cs
Browse files Browse the repository at this point in the history
Check if the domain just has one spf record. See: https://datatracker.ietf.org/doc/html/rfc4408#section-3.1.2
  • Loading branch information
markvantilburg authored Sep 30, 2024
1 parent ba2e9b5 commit 7398cd6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions BusinessMonitor.MailTools/Spf/SpfCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ private SpfRecord GetRecord(string domain)
throw new SpfNotFoundException("No SPF record found on domain");
}

if (record.Length > 1)
{
throw new SpfNotFoundException("Too many SPF records found on domain");
}

// Parse and validate the record and return it
var parsed = ParseSpfRecord(record);

Expand Down

0 comments on commit 7398cd6

Please sign in to comment.