Bug 102242 - Sendmail report for messages sent & bytes transferred is broken
Sendmail report for messages sent & bytes transferred is broken
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: logwatch (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Elliot Lee
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-08-12 17:26 EDT by Nick White
Modified: 2007-04-18 12:56 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-08-20 15:10:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Nick White 2003-08-12 17:26:34 EDT
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:
Comment 1 Elliot Lee 2003-08-13 10:13:14 EDT
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.
Comment 2 Gilles Detillieux 2003-10-22 12:27:20 EDT
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
Comment 3 Nick White 2003-10-22 13:28:30 EDT
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
Comment 4 Elliot Lee 2004-08-20 15:10:44 EDT
It appears that logwatch 5.2.2 has this bug fixed. Cool! Thanks for
the bug report...

Note You need to log in before you can comment on or make changes to this bug.