diff --git a/CHANGELOG.md b/CHANGELOG.md index a2298d0..5384918 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ - **FIX** `Test-DaneRecords` now correctly checks DANE records for domains without MX records. - **FIX** The DMARC `fo` token is now parsed correctly when multiple values are present. - **FIX** The DMARC `rf` token is now parsed correctly. -- **FIX** The SPF `mx` token parser no longer generates a spurious error when not counting DNS lookups. +- **FIX** The SPF `exists` and `mx` token parsers no longer generate a spurious error when *not* counting DNS lookups. - **FIX** IntelliSense's handling of `Test-SpfRecord` has been improved by hiding some internal-use-only parameters. - **FIX** Cleaned up `Test-DaneRecords`' output. - **FIX** Miscellaneous code cleanup to improve future maintenance. diff --git a/MailPolicyExplainer.psd1 b/MailPolicyExplainer.psd1 index 198390e..2f89da0 100644 --- a/MailPolicyExplainer.psd1 +++ b/MailPolicyExplainer.psd1 @@ -174,7 +174,7 @@ Many bugs were fixed, too: - The DMARC `fo` token is now parsed correctly when multiple values are present. - The DMARC `rf` token is now parsed correctly. - The IntelliSense handling of `Test-SpfRecord` has been improved by hiding some internal-use-only parameters. -- The SPF `mx` token parser no longer generates a spurious error when not counting DNS lookups. +- The SPF `exists` and `mx` token parsers no longer generate a spurious error when not counting DNS lookups. - Cleaned up the output of `Test-DaneRecords` a little. - Miscellaneous code cleanup. ' diff --git a/src/MailPolicyExplainer.psm1 b/src/MailPolicyExplainer.psm1 index 9bd1681..213f1c1 100644 --- a/src/MailPolicyExplainer.psm1 +++ b/src/MailPolicyExplainer.psm1 @@ -1276,7 +1276,10 @@ Function Test-SpfRecord #region Check exists tokens ElseIf ($token -Match "^[\+\-\?\~]?exists:.*") { - $DnsLookups.Value++ + If ($CountDnsLookups) { + $DnsLookups.Value++ + } + If ($token -Match "^\+?exists:.*") { Write-GoodNews "${RecordType}: Accept mail if $($token -Replace '\+' -Replace 'exists:') resolves to an A record.$(Write-DnsLookups $DnsLookups -Enabled:$CountDnsLookups)" }