From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705) Description of problem: LogWatch is supposed to report the bytes transferred and messages sent for sendmail, when $MsgsSent is greater than 0. The problem is, that no matter what, $MsgsSent is always null, so it never runs the if statement. The offending code is in /etc/log.d/scripts/services/sendmail. if($MsgsSent > 0) { print "\n\n" . $BytesTransferred . " bytes transferred"; print "\n" . $MsgsSent . " messages sent"; } If I change the if statement to if(1) { it works. Version-Release number of selected component (if applicable): logwatch-4.3.1-2 How reproducible: Always Steps to Reproduce: 1. Send lots of messages through sendmail. 2. Set the detail level in logwatch.conf to 10 or High. 3. Run the logwatch script. Notice that it doesn't send any information about bytes transferred, or messages sent. 4. Modify the if statement in the sendmail script. 5. Rerun the logwatch script, and it will send bytes transferred and messages sent information. Additional info:
The real problem is that the pattern that increments MsgsSent and BytesTransferred is not matching the lines in maillog. Need to get a working pattern.
The pattern for finding the messages sent and total bytes is fine. The problem is that $Detail isn't set. You need to add $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'}; at the start of /etc/log.d/scripts/services/sendmail. The odd thing is Nick reported that the offending code began with... if($MsgsSent > 0) { whereas on my Red Hat 9 system, with logwatch-4.3.1-2 installed, I find this section begins with... if (($MsgsSent > 0) and ($Detail >= 5)) { Setting $Detail as above made the difference for me. If Nick did actually change the 'if' statement to remove the reference to $Detail, then I'm not sure what the problem is, as I can't reproduce it here. Cheers, Gilles
I just realized that the offending code($MsgsSent > 0) { probably came from a version < RedHat 9. I've tried adding the $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'}; to the top of the sendmail script, and it seems to work like a charm. Thanks, nw
It appears that logwatch 5.2.2 has this bug fixed. Cool! Thanks for the bug report...