Patch for mailscanner script
John Wilcock <[email protected]>
| Newsgroups | gmane.comp.log.logwatch.devel |
|---|---|
| Message-ID | <[email protected]> |
Here's a short patch to count messages affected by MailScanner's watermarking function. John. -- -- Over 3000 webcams from ski resorts around the world - www.snoweye.com -- Translate your technical documents and web pages - www.tradoc.fr _______________________________________________ Logwatch-Devel mailing list [email protected] http://www2.list.logwatch.org:81/mailman/listinfo/logwatch-devel
mailscanner-watermarks.patch
(text/plain, 1.3 KB)
--- mailscanner1.31 2008-05-14 10:18:32.000000000 +0200
+++ mailscanner-jw 2008-05-14 10:59:47.000000000 +0200
@@ -48,6 +48,8 @@
my $MailScan_Virus = 0;
my $SA_timeout = 0;
my $MailScan_ScannerTimeout = 0;
+my $MailScan_GoodWatermark = 0;
+my $MailScan_BadWatermark = 0;
while (defined($ThisLine = <STDIN>)) {
#($QueueID) = ($ThisLine =~ m/^([a-zA-Z0-9]+): / );
@@ -290,6 +292,10 @@
} elsif ($ThisLine =~ m/RBL checks: .+ found in (.+)/i) {
$RBLType{$1}++;
$MailScan_RBL++;
+ } elsif ($ThisLine =~ m/Valid Watermark HASH found in Message/) {
+ $MailScan_GoodWatermark++;
+ } elsif ($ThisLine =~ m/Message .+ had bad watermark/) {
+ $MailScan_BadWatermark++;
} else {
chomp($ThisLine);
# Report any unmatched entries...
@@ -561,6 +567,13 @@
print ' ' . "Details Suppressed at level $Detail. Level 10 required.\n";
}
}
+
+if ( ($MailScan_GoodWatermark > 0) || ($MailScan_BadWatermark > 0) ) {
+ print "\nWatermark report:\n";
+ print " Messages with good watermark: $MailScan_GoodWatermark\n";
+ print " Messages with null sender and bad or no watermark: $MailScan_BadWatermark\n";
+ }
+
if (keys %OtherList) {
print "\n**Unmatched Entries**\n";
foreach $line (sort {$OtherList{$b}<=>$OtherList{$a} } keys %OtherList) {