Red Hat Bugzilla – Bug 407611
emails generated by cron have improperly formatted Date: headers
Last modified: 2007-12-20 15:11:30 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:18.104.22.168) Gecko/20061201 Firefox/22.214.171.124 (Ubuntu-feisty)
Description of problem:
First bug post, please be gentle.
Vixie cron has a feature where if any program that produces stdout or stderr (without redirection) is emailed to the user of the crontab (or MAILTO if defined). I've just freshly installed Core 8, and the cron-generated emails from it are getting appearing with the wrong date in my inbox, but are sent at the correct time. The box time is set to UTC, and the timezone is Australia/Adelaide.
Examining further, the date header generated by the FC8 cron is
Date: Sun, 2 Dec 2007 00:01:01 1030 (CST)
The same report coming from an FC6 box has:
Date: Sun, 2 Dec 2007 04:02:02 +1030
(Note that the CST string is commented, so that shouldn't be a concern).
It appears that between FC6 (running vixie-cron-4.1-64.fc6) and FC8 the cron program now generates its own Date: header (at least, as identified by strings) instead of relying on the underlying MSA to do it. According to RFC822, the timezone offset should be prefaced with +/-, so this is probably what's causing the mail reader (Thunderbird 1.5) to improperly decode and display the date.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Server clock set to UTC, and a definite timezone offset (e.g. Australia/Adelaide)
2. Add a crontab entry: echo "hi there"
3. Wait for cronjob to run
View result in mail reader; note time that email arrived vs time displayed. Examine email source for "pre-rendered" Date string.
e.g. received email with "Date: Sun, 2 Dec 2007 00:01:01 1030 (CST)", email client shows email received at 16:31
Email from FC6 cron server with "Date: Sun, 1 Dec 2007 00:00:01 +1030", email client shows email received at 00:00
Nothing special about this configuration.
I grabbed the source rpm to vixie-cron and poked into this further. It looks
like the MAIL_DATE macro is now defined which causes the use of the
misc.c/arpadate() function. Looking at the sprintf() format string used in the
function to print the timezone offset it appears that this would work correctly
for negative offsets, but not positive ones (as is the case here).
It will be fixed in the next update vixie-cron-4.2-6.fc8
vixie-cron-4.2-6.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 vixie-cron'
Tested update, appears good. Thanks!
vixie-cron-4.2-6.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.