From 7398cd6a65bb061dcb9df9d47045e692fee41a46 Mon Sep 17 00:00:00 2001 From: mark van tilburg Date: Mon, 30 Sep 2024 17:34:40 +0200 Subject: [PATCH] Update SpfCheck.cs Check if the domain just has one spf record. See: https://datatracker.ietf.org/doc/html/rfc4408#section-3.1.2 --- BusinessMonitor.MailTools/Spf/SpfCheck.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BusinessMonitor.MailTools/Spf/SpfCheck.cs b/BusinessMonitor.MailTools/Spf/SpfCheck.cs index 632ec7a..f7ca3e0 100644 --- a/BusinessMonitor.MailTools/Spf/SpfCheck.cs +++ b/BusinessMonitor.MailTools/Spf/SpfCheck.cs @@ -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);