[Logwatch-Devel] Old problem with sendmail script and a small patch to same

Robert J. Placious bob at wishiwasonthe.net
Tue Feb 14 07:55:59 MST 2006


Hello fellow logwatch folks,

It has been ages since I have contributed anything, so I'll try to make up for that today. :)

We noticed in the last couple of days the following messages in the logwatch output from
our main sendmail machines:

--------------------- sendmail Begin ------------------------

 Nested quantifiers in regex; marked by <-- HERE in m/<** <-- HERE *z at somedomain.com>\.\.\. / at /usr/share/logwatch/scripts/services/sendmail line 601, <STDIN> line 1251.

 ---------------------- sendmail End -------------------------


It appears that entries of the form:

"Feb 13 02:33:47 frack sendmail[16693]: k1D7XeN1016693: ruleset=check_rcpt, arg1=<***son at somedomain.com>, relay=p5082
C99F.dip.t-dialin.net [80.130.201.159], reject=550 5.7.1 <***son at somedomain.com>... Rejected: 80.130.201.159 listed
at dnsbl.sorbs.net"

are the culprit. Perl thinks those asterisks in the username is a regular expression that it needs to deal with.
This happens with 7.0 and 7.2.1.
A little googling showed a similar issue a few years ago. In any case, here is a diff against what is in the CVS
repository. This seems to fix the problem.

Regards,
Bob

 cvs diff -u sendmail
Index: sendmail
===================================================================
RCS file: /var/cvs/logwatch/scripts/services/sendmail,v
retrieving revision 1.64
diff -u -r1.64 sendmail
--- sendmail    15 Dec 2005 17:29:33 -0000      1.64
+++ sendmail    14 Feb 2006 14:29:59 -0000
@@ -621,7 +621,7 @@
       $CheckMailReject{$Temp}++;
    # file: sendmail.cf
    } elsif( ($Arg,$Relay,$Reason) = ($ThisLine =~ /^ruleset=check_rcpt, arg1=(.*), relay=.*?\[(.*)\].*, reject=(.*)/) ) {
-       $Reason =~ s/$Arg\.\.\. //;
+       $Reason =~ s/\Q$Arg\E\.\.\. //;
        $Temp = "$Arg ($Reason)";
        $CheckRcptReject{$Temp}++;
        $Msgs{$QueueID}{"BadRCPT"}++;


More information about the Logwatch-Devel mailing list