-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new Get-RejectionReport script which interacts directly with th…
…e database. This is much faster.
- Loading branch information
NETATWORK\hkrause
committed
Aug 10, 2017
1 parent
35e6a4b
commit 37c8c51
Showing
8 changed files
with
334 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
declare @startdate datetime = convert(datetime, '{0}', 104) | ||
declare @enddate datetime = convert(datetime, '{1}', 104) | ||
|
||
select | ||
name, | ||
case | ||
when Decision = 2 then 'Temporary Blocked' | ||
when Decision = 3 then 'Permanently Blocked' | ||
end Decision, | ||
count(*) Count | ||
from MessageTracking.Action a | ||
join MessageTracking.MessageTrackEntry m | ||
on a.MessageTrackId = m.id | ||
where m.Sent >@startdate and m.Sent < @enddate and (m.status = 3 or m.status = 4) and (Decision = 2 or Decision = 3) | ||
group by name, Decision |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
declare @startdate datetime = convert(datetime, '{0}', 104) | ||
declare @enddate datetime = convert(datetime, '{1}', 104) | ||
|
||
select | ||
case | ||
when WasReceivedFromRelayServer = 0 then 'Inbound' | ||
when WasReceivedFromRelayServer = 1 then 'Outbound' | ||
else 'Summary' | ||
end Direction, | ||
case | ||
when Status = 1 then 'Success' | ||
when Status = 3 then 'Temporary Blocked' | ||
when Status = 4 then 'Permanently Blocked' | ||
when Status is null then 'Summary' | ||
end Status, | ||
COUNT(*) Count | ||
from MessageTracking.MessageTrackEntry | ||
where Sent > @startdate and Sent < @enddate and (status = 1 or status = 3 or status = 4) | ||
group by rollup (WasReceivedFromRelayServer, status) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
declare @startdate datetime = convert(datetime, '{0}', 104) | ||
declare @enddate datetime = convert(datetime, '{1}', 104) | ||
|
||
select | ||
name, | ||
count(*) Count | ||
from MessageTracking.Filter f | ||
join MessageTracking.MessageTrackEntry m | ||
on f.MessageTrackId = m.id | ||
where m.Sent > @startdate and m.Sent < @enddate and (m.status = 3 or m.status = 4) and (f.Scl > 0) | ||
group by name |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,219 @@ | ||
param ( | ||
[Parameter(Mandatory=$false)][int] $NumberOfDaysToReport = 7, | ||
[Parameter(Mandatory=$true)][string] $SMTPHost, | ||
[Parameter(Mandatory=$false)][string] $ReportSender = "NoSpamProxy Report Sender <[email protected]>", | ||
[Parameter(Mandatory=$true)][string] $ReportRecipient, | ||
[Parameter(Mandatory=$false)][string] $ReportSubject = "Auswertung", | ||
[Parameter(Mandatory=$false)][string] $SqlServer = "(local)", | ||
[Parameter(Mandatory=$false)][pscredential] $Credential, | ||
[Parameter(Mandatory=$false)][string] $Database = "NoSpamProxyAddressSynchronization" | ||
) | ||
$reportFileName = [Path]::Combine($Env:TEMP, "reject-analysis.html") | ||
$totalRejected = 0 | ||
$tempRejected = 0 | ||
$permanentRejected = 0 | ||
$rblRejected = 0 | ||
$cyrenSpamRejected = 0 | ||
$cyrenAVRejected = 0 | ||
$surblRejected = 0 | ||
$characterSetRejected = 0 | ||
$wordRejected = 0 | ||
$contentrejected = 0 | ||
$greylistrejected = 0 | ||
$rdnsPermanentRejected = 0 | ||
$decryptPolicyRejected = 0 | ||
$dateStart = (Get-Date).AddDays(-$NumberOfDaysToReport) | ||
$dateTo = Get-Date -format "dd.MM.yyyy" | ||
$dateFrom = $dateStart.ToString("dd.MM.yyyy") | ||
|
||
function New-DatabaseConnection() { | ||
$connectionString = "Server=$SqlServer;Database=$Database;" | ||
if ($Credential) { | ||
$connectionString += "uid=" + $Credential.UserName + ";pwd=" + $Credential.Password + ";" | ||
} | ||
else { | ||
$connectionString +="Integrated Security=True"; | ||
} | ||
$connection = New-Object System.Data.SqlClient.SqlConnection | ||
$connection.ConnectionString = $connectionString | ||
|
||
$connection.Open() | ||
|
||
return $connection; | ||
} | ||
|
||
function Coalesce-Zero($a) { | ||
if ($a) { $a } else { 0 } | ||
} | ||
|
||
function Invoke-SqlQuery([string] $queryName) { | ||
$connection = New-DatabaseConnection | ||
try { | ||
$command = $connection.CreateCommand() | ||
$command.CommandText = (Get-Content "$queryName.sql") -f $dateFrom, $dateTo | ||
$result = $command.ExecuteReader() | ||
$table = new-object "System.Data.DataTable" | ||
$table.Load($result) | ||
return $table | ||
} | ||
finally { | ||
$connection.Close(); | ||
} | ||
|
||
} | ||
|
||
"Getting MessageTracks..." | ||
$blockedMessageStatistics = Invoke-SqlQuery "BlockedMessageTracks" | ||
"Getting actions statistics..." | ||
$actions = Invoke-SqlQuery "Actions" | ||
"Getting filter statistics..." | ||
$filters = Invoke-SqlQuery "Filters" | ||
"Building report." | ||
|
||
$totalMails = $blockedMessageStatistics | Where-Object {$_.Direction -eq "Summary" -and $_.Status -eq "Summary"} | Select-Object -ExpandProperty Count -First 1 | ||
$tempRejected = $blockedMessageStatistics | Where-Object {$_.Direction -eq "Inbound" -and ($_.Status -eq "Temporary Blocked")} | Select-Object -ExpandProperty Count -First 1 | ||
$permanentRejected = $blockedMessageStatistics | Where-Object {$_.Direction -eq "Inbound" -and ($_.Status -eq "Permanently Blocked")} | Select-Object -ExpandProperty Count -First 1 | ||
$totalRejected = $tempRejected + $permanentRejected | ||
$totalRejected += $blockedMessageStatistics | Where-Object {$_.Direction -eq "Inbound" -and ($_.Status -eq "Temporary Blocked")} | Select-Object -ExpandProperty Count -First 1 | ||
$inboundmessages = $blockedMessageStatistics | Where-Object {$_.Direction -eq "Inbound" -and $_.Status -eq "Summary"} | Select-Object -ExpandProperty Count -First 1 | ||
$outboundmessages = $blockedMessageStatistics | Where-Object {$_.Direction -eq "Outbound" -and $_.Status -eq "Summary"} | Select-Object -ExpandProperty Count -First 1 | ||
|
||
$rblRejected = Coalesce-Zero ($filters | Where-Object {$_.Name -eq "realtimeBlocklist" } | Select-Object -ExpandProperty Count -First 1) | ||
$surblRejected = Coalesce-Zero ($filters | Where-Object {$_.Name -eq "surblFilter" } | Select-Object -ExpandProperty Count -First 1) | ||
$cyrenSpamRejected = Coalesce-Zero ($filters | Where-Object {$_.Name -eq "cyrenFilter" } | Select-Object -ExpandProperty Count -First 1) | ||
$characterSetRejected = Coalesce-Zero ($filters | Where-Object {$_.Name -eq "characterSetFilter" } | Select-Object -ExpandProperty Count -First 1) | ||
$wordRejected = Coalesce-Zero ($filters | Where-Object {$_.Name -eq "wordFilter" } | Select-Object -ExpandProperty Count -First 1) | ||
$rdnsPermanentRejected = Coalesce-Zero ($filters | Where-Object {$_.Name -eq "reputation" } | Select-Object -ExpandProperty Count -First 1) | ||
$cyrenAVRejected = Coalesce-Zero ($actions | Where-Object {$_.Name -eq "cyrenAction" } | Select-Object -ExpandProperty Count -First 1) | ||
$contentrejected = Coalesce-Zero ($actions | Where-Object {$_.Name -eq "ContentFiltering" } | Select-Object -ExpandProperty Count -First 1) | ||
$decryptPolicyRejected = Coalesce-Zero ($actions | Where-Object {$_.Name -eq "validateSignatureAndDecrypt" } | Select-Object -ExpandProperty Count -First 1) | ||
|
||
|
||
$mailsprocessed = $outboundmessages+$inboundmessages | ||
$blockedpercentage = [Math]::Round($totalRejected/$inboundmessages*100,2) | ||
$cyrenspamblockpercentage = [Math]::Round($cyrenSpamRejected/$totalRejected*100,2) | ||
$cyrenavblockpercentage = [Math]::Round($cyrenAVRejected/$totalRejected*100,2) | ||
$surblblockedpercentage = [Math]::Round($surblRejected/$totalRejected*100,2) | ||
$charactersetblockedpercentage = [Math]::Round($characterSetRejected/$totalRejected*100,2) | ||
$wordrejectedblockedpercentage = [Math]::Round($wordRejected/$totalRejected*100,2) | ||
$decryptpolicyblockedpercentage = [Math]::Round($decryptPolicyRejected/$totalRejected*100,2) | ||
$rblRejectedpercentage = [Math]::Round($rblRejected/$totalRejected*100,2) | ||
$reputationFilterRejectedpercentage = [Math]::Round($rdnsPermanentRejected/$totalRejected*100,2) | ||
$contentrejectedpercentage = [Math]::Round($contentRejected/$totalRejected*100,2) | ||
$greylistrejectedpercentage = [Math]::Round($greylistRejected/$totalRejected*100,2) | ||
Write-Host " " | ||
Write-Host "TemporaryReject Total:" $tempRejected | ||
Write-Host "PermanentReject Total:" $permanentRejected | ||
Write-Host "TotalReject:" $totalRejected | ||
Write-Host " " | ||
Write-Host "Sending E-Mail to " $ReportRecipient "..." | ||
|
||
$htmlout = "<html> | ||
<head> | ||
<title>Auswertung der abgewiesenen E-Mails</title> | ||
<style> | ||
table, td, th { border: 1px solid #00cc00; border-collapse: collapse; } | ||
th, td {padding-left:1em; padding-right:1em;} | ||
td:not(:first-child){text-align:right;} | ||
th {color:white;} | ||
#headerzeile {background-color: #00cc00;} | ||
</style> | ||
</head> | ||
<body style=font-family:arial> | ||
<table> | ||
<tr id=headerzeile><th>"+ $dateFrom +" bis "+ $dateTo +" ("+$NumberOfDaysToReport+" Tage)</th><th>Count</th><th>Percent</th></tr> | ||
<tr><td>Mails Processed</td><td>" + $mailsprocessed +"</td><td> </td></tr> | ||
<tr><td>Sent</td><td>" + $outboundmessages +"</td><td> </td></tr> | ||
<tr><td>Received</td><td>" + $inboundmessages +"</td><td> </td></tr> | ||
<tr><td>Mails blocked</td><td>" + $totalRejected +"</td><td>" + $blockedpercentage +" %</td></tr> | ||
<tr><td>Realtime Blocklist Check</td><td>" + $rblRejected +"</td><td>" + $rblRejectedpercentage +" %</td></tr> | ||
<tr><td>Reputation Check</td><td>" + $rdnsPermanentRejected +"</td><td>" + $reputationFilterRejectedpercentage +" %</td></tr> | ||
<tr><td>Cyren AntiSpam</td><td>" + $cyrenSpamRejected +"</td><td>" + $cyrenspamblockpercentage +" %</td></tr> | ||
<tr><td>Cyren Premium AntiVirus</td><td>" + $cyrenAVRejected +"</td><td>" + $cyrenavblockpercentage +" %</td></tr> | ||
<tr><td>Spam URI Realtime Blocklists</td><td>" + $surblRejected +"</td><td>" + $surblblockedpercentage +" %</td></tr> | ||
<tr><td>Allowed Unicode Character Sets</td><td>" + $characterSetRejected +"</td><td>" + $charactersetblockedpercentage +" %</td></tr> | ||
<tr><td>Word Matching</td><td>" + $wordRejected +"</td><td>" + $wordrejectedblockedpercentage +" %</td></tr> | ||
<tr><td>DecryptPolicy Reject</td><td>" + $decryptPolicyRejected +"</td><td>" + $decryptpolicyblockedpercentage +" %</td></tr> | ||
<tr><td>ContentFiltering</td><td>" + $contentrejected + "</td><td>" + $contentrejectedpercentage + " %</td></tr> | ||
<tr><td>Greylisting</td><td>" + $greylistrejected + "</td><td>" + $greylistrejectedpercentage + " %</td></tr> | ||
</table> | ||
</body> | ||
</html>" | ||
|
||
|
||
$htmlout | Out-File $reportFileName | ||
"Sending report to $ReportRecipient" | ||
Send-MailMessage -SmtpServer $SmtpHost -From $ReportSender -To $ReportRecipient -Subject $ReportSubject -Body "Im Anhang dieser E-Mail finden Sie den Bericht mit der Auswertung der abgewiesenen E-Mails." -Attachments $reportFileName | ||
Write-Host "Doing some cleanup.." | ||
Remove-Item $reportFileName | ||
Write-Host "Done." | ||
|
||
|
||
# SIG # Begin signature block | ||
# MIIMSwYJKoZIhvcNAQcCoIIMPDCCDDgCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB | ||
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR | ||
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFA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# 4htpYPb3T7zyqwEnXO3Iuq57uScSICHu6LqQIdxTWqBJurQ9qAV24PiMqHCzama3 | ||
# dtEG2Qfb94JrcpYcSEmBXoQbHshLZ8sWndukB2FoWQ== | ||
# SIG # End signature block |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Get-RejectionReportNSP12.ps1 | ||
|
||
Sends a report to the specified E-Mail address which contains the following information: | ||
|
||
- Total count of processed emails. | ||
- Total count of sent emails. | ||
- Total count of received emails. | ||
- Total count of rejected emails. | ||
- Total count of rejected emails for each Filter and Action. | ||
|
||
This version uses the NoSPamProxy WebServices to acquire the required information. This is suited for small to medium sized installations. For large installations, the [Database Version](../Get-RejectionReport%20(Database)) version instead. | ||
|
||
## Usage | ||
|
||
```ps | ||
Get-RejectionReport -SMTPHost -ReportRecipient [-ReportSubject] [-NumberOfDaysToReport] [-ReportSender]` | ||
``` | ||
|
||
- **SMTPHost**: Mandatory. Specifies the SMTP Host which will be used to send the email. | ||
- **ReportRecipient**: Mandatory. Specifies the Recipient of the email. | ||
- **ReportSubject**: Optional. Specifies the Subject of the email. Default value is "Auswertung". | ||
- **NumberOfDaysToReport**: Optional. Specifies the Number of days to report. Default value is "7". | ||
- **ReportSender**: Optional. Specifies the Sender of the email. Default value is "NoSpamProxy Report Sender <[email protected]>". | ||
- **SqlServer**: Optional. The name of the Database server (including instance name, if any). Defaults to (local)\NoSpamProxyDB. | ||
- **Database**: Optional. Name the Database to query. Defaults to "NoSpamProxyAddressSynchronization". | ||
- **Credential**: Optional. Username and password for the SQL authentication on the database server. If not set, Integrated authentication is used, which is the default. | ||
|
||
|
||
## Example | ||
|
||
```ps | ||
.\Get-RejectionReport.ps1 -SMTPHost mail.example.com -ReportRecipient [email protected]' | ||
``` | ||
|
||
## Supported NoSpamProxy Versions | ||
|
||
This Script works for NoSpamProxy version 12.x and higher. |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Get-RejectionReportNSP12.ps1 | ||
|
||
Sends a report to the specified E-Mail address which contains the following information: | ||
|
||
- Total count of processed emails. | ||
- Total count of sent emails. | ||
- Total count of received emails. | ||
- Total count of rejected emails. | ||
- Total count of rejected emails for each Filter and Action. | ||
|
||
This version uses the NoSPamProxy WebServices to acquire the required information. This is suited for small to medium sized installations. For large installations, the [Database Version](../Get-RejectionReport%20(Database)) version instead. | ||
|
||
## Usage | ||
|
||
```ps | ||
Get-RejectionReport -SMTPHost -ReportRecipient [-ReportSubject] [-NumberOfDaysToReport] [-ReportSender]` | ||
``` | ||
|
||
- **SMTPHost**: Mandatory. Specifies the SMTP Host which will be used to send the email. | ||
- **ReportRecipient**: Mandatory. Specifies the Recipient of the email. | ||
- **ReportSubject**: Optional. Specifies the Subject of the email. Default value is "Auswertung". | ||
- **NumberOfDaysToReport**: Optional. Specifies the Number of days to report. Default value is "7". | ||
- **ReportSender**: Optional. Specifies the Sender of the email. Default value is "NoSpamProxy Report Sender <[email protected]>". | ||
|
||
## Example | ||
|
||
```ps | ||
.\Get-RejectionReport.ps1 -SMTPHost mail.example.com -ReportRecipient [email protected]` | ||
``` | ||
|
||
## Supported NoSpamProxy Versions | ||
|
||
This Script works for NoSpamProxy version 12.x and higher. |
This file was deleted.
Oops, something went wrong.