Skip to content

Commit

Permalink
Don't count initial SPF lookup as lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
Indra van den Berg committed Nov 4, 2023
1 parent 553cfb3 commit cbfe919
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions BusinessMonitor.MailTools/Spf/SpfCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ public SpfRecord GetSpfRecord(string domain)

_lookups = 0;

return GetRecord(domain);
return GetRecord(domain, false);
}

private SpfRecord GetRecord(string domain)
private SpfRecord GetRecord(string domain, bool lookup = true)
{
var records = _resolver.GetTextRecords(domain);
_lookups++;
if (lookup) _lookups++;

// Find the SPF record
var record = records.FirstOrDefault(x => x.StartsWith("v=spf1", StringComparison.InvariantCultureIgnoreCase));
Expand Down

0 comments on commit cbfe919

Please sign in to comment.