-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fail when MTA-STS file has non-CRLF line endings.
Up until now, `Test-MtaStsPolicy` would display an unhelpful error message -- the entire file contents! -- when it read an MTA-STS policy file with CR or LF line endings. The specification calls for CRLF line endings, and that cmdlet has always respected that. This commit causes it to parse the file twice, once with Windows-style CRLF line endings assumed, and again with UNIX-style LF line endings assumed. (We're going to assume no one is developing on classic macOS with its bizarre CR line endings.) If the results are different, then we can assume the file has invalid line endings, and we will fail with a helpful error message, rather than the token parser printing the entire file via Write-Host. DMARCian, fix your MTA-STS file!
- Loading branch information
1 parent
981377b
commit 20fd51e
Showing
3 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters