From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11 Description of problem: The logwatch-7.3.4-mailto.patch introduced in this rpm breaks the MailTo setting contained in /etc/logwatch/conf/logwatch.conf. That patch contains this: --- logwatch-7.3.4/scripts/logwatch.pl.pom 2007-04-13 15:43:35.000000000 +0200 +++ logwatch-7.3.4/scripts/logwatch.pl 2007-04-20 12:14:43.000000000 +0200 @@ -312,6 +312,13 @@ CleanVars(); +#if MAILTO is set in the environment, grab it as we may be being used by +#cron or anacron, which do not set command line args. +if ($ENV{'MAILTO'}) + { + $Config{'mailto'} = $ENV{'MAILTO'}; + } + if ($OldMailTo ne $Config{'mailto'}) { $Config{'print'} = 0; } elsif ($OldPrint ne $Config{'print'}) { The problem is that this code patch is inserted below the point where logwatch.pl has read its config file at /etc/logwatch/conf/logwatch.conf. So it clobbers the MailTo setting from that config file. This happens because in Fedora 7, logwatch is run from /etc/cron.daily/0logwatch, which is controlled from /etc/crontab, which contains a MAILTO=root line. I'm not sure what prompted this patch, but if it's truly necessary, then the code to grab MAILTO from the environment should occur *before* the script reads its config files, so that the logwatch.conf has precedence. Version-Release number of selected component (if applicable): logwatch-7.3.4-9.fc7 How reproducible: Always Steps to Reproduce: 1. set "MailTo = myself" in /etc/logwatch/conf/logwatch.conf 2. let logwatch run from /etc/cron.daily/0logwatch as usual Actual Results: No email to the configured email address in logwatch.conf. Instead the logwatch output is only emailed to the local root account. Expected Results: The logwatch output shoud be emailed to the address defined in logwatch.conf Additional info:
Thanks. Fixed in logwatch-7.3.4-10.fc7
logwatch-7.3.6-13.fc8 has been pushed to the Fedora 8 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update logwatch'
logwatch-7.3.4-10.fc7 has been pushed to the Fedora 7 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update logwatch'
logwatch-7.3.4-10.fc7 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report.
logwatch-7.3.6-13.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.
logwatch-7.3.6-13.fc8 introduced this bug to me! Downgrading to logwatch-7.3.6-12.fc8 fixed correct handling of /etc/logwatch/conf/logwatch.conf MailTo setting for me. Should be reopened.
Yes, the bug is still present in logwatch-7.3.6-13.fc8 and all our 40+ hosts are using the same version, so downgrading it would be impossible. So, this bug report should be reopened, as it needs fixing.
I'm the original reporter, and for reference, logwatch-7.3.4-10.fc7 did fix the problem on my Fedora 7 system. I don't have access to Fedora 8 to see what's wrong there.
logwatch was fine on Fedora 7 and reading its MailTo from config while running under cron, however on Fedora 8 which got logwatch-7.3.6-13.fc8 installed its no longer reading (or honoring MailTo) while its run under cron.
Ok here is the fix that works fine for me on 40+ Fedora 8 hosts, fixed was suggested on logwatch mailing list see .. http://www2.list.logwatch.org:81/pipermail/logwatch/2008-February/001679.html Under Fedora 8 to fix this issue the logwatch.pl script must be > modified. This should be reported back up to Fedora. Basically you need > to move the ENV kludge forward. Line 63 is about right and it should > look like this > > #Honor ENV MAILTO as default if exists -mgt > if ($ENV{'MAILTO'}) { > $Config{'mailto'} = $ENV{'MAILTO'}; > } else { > $Config{'mailto'} = "root"; > } > > Then remove the other ENV setting at around line 362 just remove the > whole conditional. I am sure Fedora folks will soon roll out updated rpm for logwatch after reading this bug and the solution to fix. Thanks. Askar
logwatch-7.3.6-15.fc8 has been submitted as an update for Fedora 8
logwatch-7.3.6-15.fc8 has been pushed to the Fedora 8 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update logwatch'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F8/FEDORA-2008-1885
logwatch-7.3.6-15.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.
Thank you very much after updating to logwatch-7.3.6-15.fc8 on 50+ hosts and it fixed the issue of logwatch not sending emails to which has been defined in /etc/logwatch/conf/logwatch.conf file