Skip to content

Commit

Permalink
Fix DANE non-existence error text.
Browse files Browse the repository at this point in the history
When no DANE records are present for a domain with exactly one MX
host, the cmdlet `Test-DaneRecords` would erroneously report the
domain name when it should have reported the MX server name.

For example, if contoso.com has an MX record of mail.contoso.com,
and there is no DANE record, previous versions would have said
"DANE records are not present for contoso.com" instead of "DANE
records are not present for mail.contoso.com".

The non-existence of DANE records was reported correctly, though
the error message was confusing.

As this is my first commit of 2024, I've updated the copyright year.
I've also bumped the version number to get this out as soon as
possible.
  • Loading branch information
rhymeswithmogul committed Jan 18, 2024
1 parent 31155b4 commit 3a63a53
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# MailPolicyExplainer Change Log

## Version 1.3.3 (Thursday, January 18, 2024)
**FIX** When no DANE records are present for a domain with a single MX host, `Test-DaneRecords` would erroneously report the domain name when it should have reported the MX server name.

## Version 1.3.2 (Friday, December 8, 2023)
**FIX** `Test-MtaStsPolicy` no longer misidentifies `mta-sts.txt` files with the correct CRLF line endings as malformed. This was caused by a regression in version 1.3.1.

Expand Down
8 changes: 5 additions & 3 deletions MailPolicyExplainer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
RootModule = 'src/MailPolicyExplainer.psm1'

# Version number of this module.
ModuleVersion = '1.3.2'
ModuleVersion = '1.3.3'

# Supported PSEditions
CompatiblePSEditions = @('Core', 'Desktop')
Expand All @@ -19,7 +19,7 @@ GUID = 'b3ec0108-05d3-43f1-a5ba-cc8f7f4cc8cc'
Author = 'Colin Cogle'

# Copyright statement for this module
Copyright = '(c) 2018, 2020, 2023 Colin Cogle. All rights reserved.'
Copyright = '(c) 2018, 2020, 2023-2024 Colin Cogle. All rights reserved.'

# Description of the functionality provided by this module
Description = "Explains a domain's email DNS records, including MX, SPF, DKIM, DMARC, and more."
Expand Down Expand Up @@ -112,7 +112,9 @@ PrivateData = @{
ProjectUri = 'https://github.com/rhymeswithmogul/MailPolicyExplainer'
IconUri = 'https://raw.githubusercontent.com/rhymeswithmogul/MailPolicyExplainer/main/icon/PSGallery.png'

ReleaseNotes = '`Test-MtaStsPolicy` no longer misidentifies `mta-sts.txt` files with the correct CRLF line endings as malformed. This was caused by a regression in version 1.3.1.'
ReleaseNotes = 'This is a bugfix release. When no DANE records are present for a domain with a single MX host, `Test-DaneRecords` would erroneously report the domain name when it should have reported the MX server name.
For example, if the only MX record was pointing to mail.contoso.com, the old error message would have said "DANE records are not present for contoso.com" instead of "DANE records are not present for mail.contoso.com".'
}
}

Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# MailPolicyExplainer News

## Version 1.3.3
This was released on Thursday, January 17, 2024.

This is a bugfix release. When no DANE records are present for a domain with a single MX host, `Test-DaneRecords` would erroneously report the domain name when it should have reported the MX server name. For example, "DANE records are not present for contoso.com" instead of "DANE records are not present for mail.contoso.com". The non-existence of DANE records was reported correctly, though the error message was confusing.

## Version 1.3.2
This was released on Friday, December 8, 2023.

Expand Down
4 changes: 2 additions & 2 deletions release/New-Release.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of MailPolicyExplainer.
# This file is part of MailPolicyExplainer.
#
# MailPolicyExplainer is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by the
Expand Down Expand Up @@ -39,7 +39,7 @@ Copy-Item -Path '*' -Destination $DestinationPath -Recurse -Exclude @(
)
Push-Location -Path $DestinationPath
#endregion

I
#region Sign all script files.
# This portion of the script signs all files with my code signing certificate.
# Since the command's default parameters are defined in my shell, and my private
Expand Down
4 changes: 2 additions & 2 deletions src/MailPolicyExplainer.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ Function Test-DaneRecord
# We're checking for a count of zero, or a count of one where the server
# name is blank, just in case I add options for other DNS APIs in the future.
# Google Public DNS's API returns the latter format.
If ($MXServers.Count -eq 0 -or ($MXServers.Count -eq 1 -and $null -eq $MXServers[0].Name))
If ($MXServers.Count -eq 0)
{
$MXServers = @(@{'Preference'=0; 'Server'=$DomainName})
}
Expand All @@ -397,7 +397,7 @@ Function Test-DaneRecord
$DnsLookup = Invoke-GooglePublicDnsApi "_25._tcp.$MXName" 'TLSA' -Debug:$DebugPreference
If ($DnsLookup.PSObject.Properties.Name -NotContains 'Answer' -or $DnsLookup.Status -eq 2 -or $DnsLookup.Status -eq 3)
{
Write-BadNews "DANE: DANE records are not present for $MXName, TCP port 25."
Write-BadNews "DANE: DANE records are not present for ${MXName}, TCP port 25."
Return
}

Expand Down

0 comments on commit 3a63a53

Please sign in to comment.