Bug 426718
Summary: | env mailto value overrides conf file value | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Tom Shield <twshield> |
Component: | vixie-cron | Assignee: | Marcela Mašláňová <mmaslano> |
Status: | CLOSED NEXTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 7 | CC: | mwc, varekova |
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: | 2008-02-08 14:08:32 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Tom Shield
2007-12-24 22:58:36 UTC
This is not logwatch bug - the mail is sent by cron so the addressee itself so there is no way for logwatch to change it. Cron is running logwatch from cron.daily, which is run from /etc/crontab. Here is defined the enviroment. Cron is overriding the settings of individual programs. Usually is the receiver of root mails set in /etc/aliases, which I recommend. Did this setting solve your problem? The point is that I want logwatch output mailed to a different address while cron output and the rest of root's mail goes to root. This should be configurable in the /etc/logwatch/conf/logwatch.conf file, but as explained below the modification involving the piece of code above is stopping this and this is a change from previous behavior. The piece of code above, which appears to have been added to logwatch.pl by the rpm packager (It's not in the source for logwatch from their site) imports the MAILTO environment setting that is set in /etc/crontab. The location of the piece of code in logwatch.pl is after all logwatch configuration files have been read in, thus it overrides them. So the setting of MAILTO from /etc/crontab overrides any setting in /etc/logwatch/conf/logwatch.conf. /etc/crontab has MAILTO=root in it as supplied with the cron rpm. Thus with this setup, there is no way to individually have logwatch output mailed to an address in the logwatch.conf file without removing the MAILTO line entirely from /etc/crontab (if this then makes MAILTO undefined in the cron environment, which I have not checked). I can see the idea behind this patch. Change the MAILTO in the /etc/crontab and all cron output (including logwatch output) does to the same place. But this should not override configuration for logwatch if it is set to mail somewhere else. And because MAILTO is by default set in /etc/crontab it will always do so, making any attempt to set a mail recipient in a logwatch.conf file futile. I don't think this is expected behavior. You need to pass this on to whoever put together the logwatch rpm and added the code above (I'm assuming they are the same person). This change appeared the rpm version listed above. It is not in the previous version. Prior to this rpm version logwatch.conf controlled where logwatch output was mailed when it was run from /etc/crontab. I hope this explains the issue better. Thanks, Tom This has been fixed in logwatch-7.3.4-10.fc7, the piece of code listed above was moved to before where the configuration files are read and thus it no longer overrides the configuration file settings. You can mark this bug as resolved. Tom |