Bug 1126408 - MailTo specified in config file ignored
Summary: MailTo specified in config file ignored
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: logwatch
Version: 7.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Jan Synacek
QA Contact: BaseOS QE - Apps
Depends On: 1126758
TreeView+ depends on / blocked
Reported: 2014-08-04 11:36 UTC by Martin Frodl
Modified: 2014-08-05 09:17 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1126758 (view as bug list)
Last Closed: 2014-08-05 09:17:19 UTC

Attachments (Terms of Use)

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):

How reproducible:

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'
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.

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