postfix script patch
"Mark H. Granoff" <[email protected]>
| Newsgroups | gmane.comp.log.logwatch.devel |
|---|---|
| Message-ID | <[email protected]> |
I added the following to the postfix service script from the 7.3.2-2
RPM, which I installed on my Fedora Core 5 system. I got tired of all
the unmatched log entries for failed RBL lookups.
You can decide, ultimately, if the line I added for 'RBL Lookup error'
should in fact replace the original pattern for this log entry (which is
right above where I added mine).
--- postfix.original 2007-02-07 10:34:38.000000000 -0500
+++ postfix 2007-02-07 10:32:31.000000000 -0500
@@ -316,6 +316,10 @@ while (defined($ThisLine = <STDIN>)) {
$Temp = "$Host : $Reason";
$RBLError{$Site}{$Temp}++;
$ErrorRBL++;
+ } elsif ( ($Host,$Site,$Reason) = ($ThisLine =~ /warning: ([^ ]*):
RBL lookup error: Host or domain name not found. Name service error for
name=\d+\.\d+\.\d+\.\d+\.([^ ]*) type=A: (.*)$/)) {+ $Temp = "$Host
: $Reason";
+ $RBLError{$Site}{$Temp}++;
+ $ErrorRBL++;
} elsif ( ($Host,$Site,$Reason) = ($ThisLine =~ /discard: RCPT from
([^ ]*\[[^ ]*\]): ([^ ]*): ([^;]*);/)) {
$Discarded{$Site}{$Reason}++;
} elsif ( (undef,undef,$Error) = ($ThisLine =~ /warning: ([^ ]*):
hostname ([^ ]*) verification failed: (.*)$/)) {
Thanks for a great tool!
-Mark
--
Mark H. Granoff
mark at granoff dot net
http://www.granoff.net