Bug 20821

Summary: logrotate mails gzipped logs
Product: [Retired] Red Hat Linux Reporter: Need Real Name <bernhard.erdmann>
Component: logrotateAssignee: Preston Brown <pbrown>
Status: CLOSED WORKSFORME QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: dr
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-06-21 15:46:50 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Need Real Name 2000-11-14 02:15:28 EST
logrotate-3.5.2-1 mails gzipped logs (binary data as mail text) if compress
and delaycompress set, but mail first not set.

/etc/logrotate.conf:
compress
delaycompress
mail be@berdmann.de

--> leads to this mail

Return-path: <root@berdmann.de>
Envelope-to: be@berdmann.de
Delivery-date: Sun, 12 Nov 2000 04:02:37 +0100
Received: from root by ente.berdmann.de with local (Exim 3.16 #2)
        id 13unPg-0007Wz-00
        for be@berdmann.de; Sun, 12 Nov 2000 04:02:36 +0100
To: be@berdmann.de
Subject: /var/log/httpd/access_log.5.gz
Message-Id: <E13unPg-0007Wz-00@ente.berdmann.de>
From: root <root@berdmann.de>
Date: Sun, 12 Nov 2000 04:02:36 +0100

<6i9access_log.1


This didn't happen with logrotate-3.3.2.


I tracked it down to line 513 in logrotate.c (from 3.5.2):

		    if ((log->flags & LOG_FLAG_COMPRESS) &&
			    !(log->flags & LOG_FLAG_DELAYCOMPRESS) &&
			    (log->flags & LOG_FLAG_MAILFIRST))
			sprintf(command, "%s < %s | %s '%s' %s", 
				    UNCOMPRESS_PIPE, mailFilename, mailCommand,
				    log->files[logNum],
				    log->logAddress);
		    else
			sprintf(command, "%s '%s' %s < %s", mailCommand, 
				    mailFilename, log->logAddress, mailFilename);



In 3.3.2 this part reads as follows (line 500):

		    if (log->flags & LOG_FLAG_COMPRESS)
			sprintf(command, "%s < %s | %s '%s' %s", 
				    UNCOMPRESS_PIPE, mailFilename, mailCommand,
				    log->files[logNum],
				    log->logAddress);
		    else
			sprintf(command, "%s '%s' %s < %s", mailCommand, 
				    mailFilename, log->logAddress, mailFilename);
Comment 1 Preston Brown 2001-06-21 15:46:33 EDT
this would seem to mean that delaycompress wasn't working.  mailfirst is supposed to 
mail the just rotated log, and the just rotated log shouldn't be compressed if 
delaycompress is in use.

Is delaycompress working for you?
Comment 2 Preston Brown 2001-08-06 13:46:54 EDT
closed due to lack of additional feedback.