Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1229774

Summary: Missing Date header in broker notifications
Product: [Retired] oVirt Reporter: Nima Saed-Samii <nima>
Component: ovirt-hosted-engine-haAssignee: Roman Mohr <rmohr>
Status: CLOSED CURRENTRELEASE QA Contact: Artyom <alukiano>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.5CC: bugs, ecohen, gklein, istein, lsurette, nima, rbalakri, sbonazzo, yeylon
Target Milestone: ---Keywords: Triaged
Target Release: 3.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sla
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-04 13:51:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1234906    

Description Nima Saed-Samii 2015-06-09 15:28:07 UTC
Description of problem:
According to RFC5322 (and the older RFC2822) each message must have a orig-date
header field (e.g. "Date: Fri, 17 Jan 2014 11:25:15 -0500").
If the broker part of ovirt-hosted-engine-ha sends a notification for a state
change, this header field is missing. Thunderbird mail clients will then display
the state change notification with the startup-date of the client.

How reproducible:
Put running hosted-engine in maintenance mode

Steps to Reproduce:
1. hosted-engine --set-maintenance --mode=global

Actual results:
Return-Path: <ovirt.de>
X-Original-To: root.de
Delivered-To: root.de
Received: from hermes2.ikp.uni-koeln.de (hermes2.ikp.uni-koeln.de [134.95.191.132])
	by hera.ikp.uni-koeln.de (Postfix) with ESMTP id 9E85D8275E
	for <root.de>; Tue, 12 May 2015 20:28:20 +0200 (CEST)
From: ovirt.de
To: root.de
Subject: ovirt-hosted-engine state transition EngineUp-GlobalMaintenance

The state machine changed state.


Expected results:
Return-Path: <ovirt.de>
X-Original-To: root.de
Delivered-To: root.de
Received: from hermes2.ikp.uni-koeln.de (hermes2.ikp.uni-koeln.de [134.95.191.132])
	by hera.ikp.uni-koeln.de (Postfix) with ESMTP id 9E85D8275E
	for <root.de>; Tue, 12 May 2015 20:28:20 +0200 (CEST)
From: ovirt.de
To: root.de
Date: Tue, 12 May 2015 20:28:20 +0200
Subject: ovirt-hosted-engine state transition EngineUp-GlobalMaintenance

The state machine changed state.

Comment 1 Doron Fediuck 2015-06-09 16:00:02 UTC
Indeed so.
It seems that adding something like the below in the right place would resolve it:
msg['Date'] = email.utils.formatdate(localtime=True)

Note that it means the mail will be using the local time of the server which sent it.

Comment 2 Artyom 2015-09-07 13:24:13 UTC
Verified on ovirt-hosted-engine-ha-1.3.0-0.4.beta.git1bcfe28.el7ev.noarch

See date under mail:
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Date: Sun, 06 Sep 2015 18:36:38 +0300
Message-Id: <20150906153638.A941132456E.lab.tlv.redhat.com>
From: root.lab.tlv.redhat.com
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22

Comment 3 Sandro Bonazzola 2015-11-04 13:51:06 UTC
oVirt 3.6.0 has been released on November 4th, 2015 and should fix this issue.
If problems still persist, please open a new BZ and reference this one.