Bug 1126408

Summary: MailTo specified in config file ignored
Product: Red Hat Enterprise Linux 7 Reporter: Martin Frodl <mfrodl>
Component: logwatchAssignee: Jan Synacek <jsynacek>
Status: CLOSED NOTABUG QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1126758 (view as bug list) Environment:
Last Closed: 2014-08-05 09:17:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1126758    
Bug Blocks:    

Description Martin Frodl 2014-08-04 11:36:15 UTC
Description of problem:

There are two ways to specify the e-mail recipient of logwatch reports: the MailTo directive in configuration file and the --mailto command-line option, the latter overriding the former. While the command-line way seems to work correctly, MailTo recipient defined in config file is ignored. Instead of sending mail, the logwatch report is printed to standard output.

Version-Release number of selected component (if applicable):
logwatch-7.4.0-28.20130522svn140.el7

How reproducible:
100%

Steps to Reproduce:

Keep the default configuration file /usr/share/logwatch/default.conf/logwatch.conf, which contains the line 'MailTo = root' already. Set the time range to 'all' by doing either of the following:

a. change 'Range = yesterday' to 'Range = all' in logwatch.conf,
   then run 'logwatch'
or
b. run 'logwatch --range all'

Run 'mail' to check whether root's inbox contains any new messages.

Actual results:
The report is printed to standard output.
No mail for root.

Expected results:
logwatch produces no output.
There is a new message in /var/spool/mail/root.

Additional info:

When mail recipient is set by the --mailto command-line option instead of the MailTo directive, the actual behaviour coincides with the expected.

This bug does not exist on either RHEL 5 or 6.

Comment 2 Jan Synacek 2014-08-05 09:17:19 UTC
By default, Output is set to 'stdout'. Change it to 'mail' if you want logwatch to send emails instead of printing to the console. The '--mailto' argument overrides the Output configuration option, therefore it is mailed correctly.