Who Knows schrieb:
Willi Mann wrote:

Could anyone who is used to postfix look at this bug please? I'm not sure what to do with this bug.

http://bugs.debian.org/317388

Willi


I just installed the latest logwatch, and believe the enclosed patch will correct this issue. I couldn't find any reject_warning in my logs for verification, but I did verifiy the patch did not break existing functionality.

But you didn't find out out whether the reject_warning line is redundant and what's the difference between the two. Before anyone can seriously apply the patch, we need to know that. Of course, from the original report, it's very likely that it's another line which would be what you intended in your patch, because of the "big" difference in the two reporting dates (33 secs), but I don't know that for sure.

- #} elsif ( ($Host,undef) = ($ThisLine =~ /reject: RCPT from ([^ ]*\[[^ ]*\]): [0-9]+ <([^ ]*)>: Sender address rejected: Domain not found;/)) { + #} elsif ( ($Host,undef) = ($ThisLine =~ /[reject|reject_warning]: RCPT from ([^ ]*\[[^ ]*\]): [0-9]+ <([^ ]*)>: Sender address rejected: Domain not found;/)) {

And that shows the problem of not really testing the patch: You are matching
t: RCPT from....
not
reject: RCPT from....

(cf. this small perl script:
my $line = "reject: RCPT";
print "matches\n" if $line =~ /[reject|reject_warning]: RCPT/;
print $&."\n";
)

Of course it works, but it confuses everyone. (Maybe it's even slower, but I'm no regex guru.)

The right expression is:
/(?:reject|reject_warning) ...../


} elsif ( ($Host,$Site) = ($ThisLine =~ /reject: RCPT from ([^ ]*\[[^ ]*\]): 554 Service unavailable; (?:Client host )?\[[^ ]*\] blocked using ([^ ]*);/)) {
       $RejectRBL{$Site}{$Host}++;
       $RejectedRBL++;
+ } elsif ( ($Host,$Site) = ($ThisLine =~ /reject: RCPT from ([^ ]*\[[^ ]*\]): 554 Service unavailable; (?:Sender address )?\[[^ ]*\] blocked using ([^ ]*);/)) {
+      $RejectRBL{$Site}{$Host}++;
+      $RejectedRBL++;

And there's another issue: If you just add it to %RejectRBL, you should use one regex for that because it's only (Sender address |Client host ) what makes the difference.
... (?:Sender address |Client host )?.... should do it.

Willi


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to