Fwd: Patch for scripts/services/sendmail
"Kirk Bauer" <[email protected]>
| Newsgroups | gmane.comp.log.logwatch.devel |
|---|---|
| Message-ID | <[email protected]> |
Passing this along for consideration... ---------- Forwarded message ---------- From: Steve Burling <[email protected]> Date: Mar 27, 2007 8:22 AM Subject: Patch for scripts/services/sendmail To: [email protected] I've attached for your consideration a patch for the sendmail filter, to properly recognize the format of our DNSBL log lines. I'll include the patch inline as well. It is based on sendmail v 1.92, just checked out from CVS. Thank for Logwatch -- it's a great tool! ------------------------- cut here ----------------------------------- --- /usr/local/src/logwatch/scripts/services/sendmail 2007-03-17 15:13:58.000000000 -0400 +++ /etc/logwatch/scripts/services/sendmail+ 2007-03-27 11:11:48.000000000 -0400 @@ -747,6 +747,14 @@ $Temp = "From " . $1 . " by " . $4; $BlackHoled{$Temp}++; $BlackHoles{$4}++; + } elsif ($ThisLine =~ /^ruleset=(?:check_relay|check_rcpt), arg1=[^,]*,(?: arg2=[^,]*,)? relay=([^,]*), reject=554\s*[\d.]*\s*.*(Mail from|Rejected) [^ ]* (refused by blackhole site|listed at|found in) (.*)/) { + $Temp = "From " . $1 . " by " . $4; + $BlackHoled{$Temp}++; + $BlackHoles{$4}++; + } elsif ($ThisLine =~ /^ruleset=(?:check_relay|check_rcpt), arg1=[^,]*,(?: arg2=[^,]*,)? reject=554\s*[\d.]*\s*.*(Mail from|Rejected) [^ ]* (refused by blackhole site|listed at|found in) (.*)/) { + $Temp = "From " . $1 . " by " . $4; + $BlackHoled{$Temp}++; + $BlackHoles{$4}++; } elsif ( ($Relay,$BlSite) = ($ThisLine =~ /^ruleset=(?:check_relay|check_rcpt), arg1=[^,]*,(?: arg2=[^,]*,)? relay=([^,]*), reject=55\d\s*[\d.]*\s*.*http:\/\/([^\/]*)\//) ) { $Temp = "From " . $Relay . " by " . $BlSite; $BlackHoled{$Temp}++; ------------------------- cut here ----------------------------------- -- Steve Burling <mailto:[email protected]> University of Michigan, ICPSR Voice: +1 734 615.3779 330 Packard Street FAX: +1 734 647.8700 Ann Arbor, MI 48104-2910 -- Kirk Bauer <[email protected]> http://linux.kaybee.org | www.autorpm.org | www.logwatch.org _______________________________________________ Logwatch-Devel mailing list [email protected] http://www2.list.logwatch.org:81/mailman/listinfo/logwatch-devel
sendmail.patch
(application/octet-stream, 1.1 KB)
--- /usr/local/src/logwatch/scripts/services/sendmail 2007-03-17 15:13:58.000000000 -0400
+++ /etc/logwatch/scripts/services/sendmail+ 2007-03-27 11:11:48.000000000 -0400
@@ -747,6 +747,14 @@
$Temp = "From " . $1 . " by " . $4;
$BlackHoled{$Temp}++;
$BlackHoles{$4}++;
+ } elsif ($ThisLine =~ /^ruleset=(?:check_relay|check_rcpt), arg1=[^,]*,(?: arg2=[^,]*,)? relay=([^,]*), reject=554\s*[\d.]*\s*.*(Mail from|Rejected) [^ ]* (refused by blackhole site|listed at|found in) (.*)/) {
+ $Temp = "From " . $1 . " by " . $4;
+ $BlackHoled{$Temp}++;
+ $BlackHoles{$4}++;
+ } elsif ($ThisLine =~ /^ruleset=(?:check_relay|check_rcpt), arg1=[^,]*,(?: arg2=[^,]*,)? reject=554\s*[\d.]*\s*.*(Mail from|Rejected) [^ ]* (refused by blackhole site|listed at|found in) (.*)/) {
+ $Temp = "From " . $1 . " by " . $4;
+ $BlackHoled{$Temp}++;
+ $BlackHoles{$4}++;
} elsif ( ($Relay,$BlSite) = ($ThisLine =~ /^ruleset=(?:check_relay|check_rcpt), arg1=[^,]*,(?: arg2=[^,]*,)? relay=([^,]*), reject=55\d\s*[\d.]*\s*.*http:\/\/([^\/]*)\//) ) {
$Temp = "From " . $Relay . " by " . $BlSite;
$BlackHoled{$Temp}++;