Skip to content

Commit

Permalink
Merge pull request #3 from skyblaster/pct_fix
Browse files Browse the repository at this point in the history
Align the $policy variable to fix the Test-DmarcRecord function.  (When did I break that?)

Signed-off-by: Colin Cogle <[email protected]>
  • Loading branch information
rhymeswithmogul committed May 22, 2024
2 parents 7b4dad4 + 2783c10 commit 325df30
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 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.4.1 (Wednesday, May 22, 2024)
**FIX** DMARC `pct` tokens are now properly explained. Thanks to [Jason Berry](https://github.com/skyblaster) for finding the bug and writing [the pull request](https://github.com/rhymeswithmogul/MailPolicyExplainer/pull/3)!

## Version 1.4.0 (Thursday, April 4, 2024)
- **NEW** Most cmdlets now have a switch, `-DisableDnssecValidation`, that does just that.
- **NEW** `Test-DkimRecord` will print the full DKIM TXT record to the verbose stream. Thanks to [Jason Berry](https://github.com/skyblaster) for writing [the pull request](https://github.com/rhymeswithmogul/MailPolicyExplainer/pull/1)!
Expand Down
8 changes: 2 additions & 6 deletions MailPolicyExplainer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ with this program. If not, see <https://www.gnu.org/licenses/>.
RootModule = 'src/MailPolicyExplainer.psm1'

# Version number of this module.
ModuleVersion = '1.4.0'
ModuleVersion = '1.4.1'

# Supported PSEditions
CompatiblePSEditions = @('Core', 'Desktop')
Expand Down Expand Up @@ -129,11 +129,7 @@ PrivateData = @{
ProjectUri = 'https://github.com/rhymeswithmogul/MailPolicyExplainer'
IconUri = 'https://raw.githubusercontent.com/rhymeswithmogul/MailPolicyExplainer/main/icon/PSGallery.png'

ReleaseNotes = '- Test-DkimRecord will emit the full DKIM TXT record to the verbose stream.
- DNSSEC-authenticated denial-of-existence is now shown by default.
- Added the `-DisableDnssecVerification` switch to most cmdlets to disable all DNSSEC checks (except for DANE).
- Removed the `ip4:` qualifier from parser output.
- Line endings for MTA-STS policy files are now parsed correctly on Windows PowerShell 5.1.'
ReleaseNotes = 'Fixes a bug where DMARC "pct" tokens were not being explained.'
}
}

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

## Version 1.4.1
This was released on Wednesday, May 22, 2024. Friend of the module [Jason Berry](https://github.com/skyblaster) [found and corrected a bug](https://github.com/rhymeswithmogul/MailPolicyExplainer/pull/3) a bug where the DMARC percentage (the `pct` token) was not being explained.

## Version 1.4.0
This was released on Thursday, April 4, 2024. It's dedicated to Mimi (2006-2024), the best cat and a very good girl.

Expand Down
8 changes: 4 additions & 4 deletions src/MailPolicyExplainer.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -754,18 +754,18 @@ Function Test-DmarcRecord
ElseIf ($token -Like "pct=*") {
$pct = [Byte]($token -Replace 'pct=')
If ($pct -eq 100) {
If ($DmarcPolicy -Match "reject") {
If ($policy -Match "reject") {
Write-Informational "DMARC: Reject 100% of email that fails DMARC (default)."
}
ElseIf ($DmarcPolicy -Match 'quarantine') {
ElseIf ($policy -Match 'quarantine') {
Write-Informational "DMARC: Quarantine 100% of email that fails DMARC (default)."
}
}
Else {
If ($DmarcPolicy -Match "reject") {
If ($policy -Match "reject") {
Write-Informational "DMARC: Only reject ${pct}% of unaligned email; the rest will be quarantined."
}
ElseIf ($DmarcPolicy -Match 'quarantine') {
ElseIf ($policy -Match 'quarantine') {
Write-BadPractice "DMARC: Only quarantine ${pct}% of unaligned email; the rest will be delivered."
}
}
Expand Down

0 comments on commit 325df30

Please sign in to comment.