Red Hat Bugzilla – Bug 1462286
yum-cron date/time on email
Last modified: 2017-07-18 06:27:58 EDT
Created attachment 1288391 [details]
adds the current date/time to the emails generated
Description of problem:
The email emitter built into yum-cron, does not add a "Date" header. While some MTAs (eg. Postfix or Exim) can be configured to add the header if it is missing, this is not always done.
With most clients (certainly with Mozilla Thunderbird, which I use), if the Date header is missing, the client will assume and show the date/time when it first saw the email.
Since the body of the email doesn't seem to include any date/time information, if the email client happens to be off or disconnected when the email is sent, it isn't clear when the yum-cron actually did anything.
Version-Release number of selected component (if applicable):
I see this using yum-cron-3.4.3-150.el7.noarch on RHEL 7.3, but I suspect it affects all versions.
- Using a host with upgrades available (yum downgrade something if needed), make sure that the "emit_via" in /etc/yum/yum-cron.conf includes email, and that the "[email]" section is set up appropriately to send emails to a specific destination, etc.
- Have two separate email clients available to access the email account receiving from the yum-cron. Leave one of the two email clients running and connected, and the other non-running/disconnected.
- Manually run "yum-cron" and let it update the packages
- Using the currently-up email client, see the email, view the headers, and notice the lack of a "Date" header
- Wait an appreciable amount of time (eg. 2-3 minutes), and launch/connect your second email client. The message will probably be shown with the date/time when your second email client was launched/connected, which will be a few minutes different than the first email client shows.
If you repeat the process after applying my attached patch, the email notification should have a "Date" header, and both clients will show the same date, despite the delay in the second one seeing the message.
Steps to Reproduce:
Just realized that I filled out the description poorly. It's easily reproducible, and those steps should've been listed below in the "Steps to Reproduce". Hopefully the rest should be clear.
I really should read the instructions better.