+++ This bug was initially created as a clone of Bug #1126408 +++
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):
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.
The report is printed to standard output.
No mail for root.
logwatch produces no output.
There is a new message in /var/spool/mail/root.
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.
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.