Bug 1032467

Summary: [RFE] Configuration of email notifications
Product: Red Hat Enterprise Virtualization Manager Reporter: Sandro Bonazzola <sbonazzo>
Component: ovirt-hosted-engine-setupAssignee: Sandro Bonazzola <sbonazzo>
Status: CLOSED ERRATA QA Contact: Leonid Natapov <lnatapov>
Severity: low Docs Contact:
Priority: high    
Version: 3.3.0CC: acathrow, dfediuck, iheim, mavital, msivak, sbonazzo, scohen, sherold, yeylon
Target Milestone: ---Keywords: FutureFeature
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: integration
Fixed In Version: ovirt-hosted-engine-setup-1.0.0-0.9.beta4.el6ev Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 1030437 Environment:
Last Closed: 2014-01-21 16:55:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1030437    
Bug Blocks:    

Description Sandro Bonazzola 2013-11-20 09:33:04 UTC
+++ This bug was initially created as a clone of Bug #1030437 +++

I am working on a feature that can report state changes using email. For that I need to configure the broker so it can send emails.

I will need the following information:

- smtp server and port
- From email address
- list of To email addresses

The configuration will be in $(engine_ha_confdir)/notifications.conf and will look like this:

[email]
smtp_server=localhost
smtp_port=25
source_email=root@localhost
destination_emails=root@localhost "Martin Sivak <msivak>" "John 'Master' Doe <john>"

There will be other sections in that file as well and those need to be kept intact for now.

--- Additional comment from Sandro Bonazzola on 2013-11-14 08:07:19 EST ---

Didi, can you take care of this? Martin correct me if I'm wrong, this is just a plain ini file parsable by ConfigParser right?
If so I think that multiple values for one key should be separated by ';'
Pay attention in escaping properly " and ' if needed.

--- Additional comment from Yedidyah Bar David on 2013-11-18 04:29:46 EST ---

I recommend to drop the "real name" part and delimit with commas, as is common in sendmail's command line. I also recommend to be very conservative in what chars we accept in email addresses - these are used for notifications and we want them to work also if the mail goes through old/buggy/unconfigured smtp gateways. E.g. allow only something like '[a-zA-Z_.-]+@[a-zA-Z_.-]+' -

destination_emails=root@localhost,admin

Also, do we want to allow to filter sending these emails based on e.g. severity or something like that?

--- Additional comment from Martin Sivák on 2013-11-18 04:42:31 EST ---

We could delimit with commas, I was actually thinking about that. Space was just easier for the initial implementation thanks to shlex :)

But I would like to support real names as we are using them in the email header (From,To) as well. And receiving email from "Hosted engine <root@localhost>" is quite different from just root@localhost.

--- Additional comment from Yedidyah Bar David on 2013-11-18 05:26:01 EST ---

(In reply to Martin Sivák from comment #3)
> We could delimit with commas, I was actually thinking about that. Space was
> just easier for the initial implementation thanks to shlex :)
> 
> But I would like to support real names as we are using them in the email
> header (From,To) as well. And receiving email from "Hosted engine
> <root@localhost>" is quite different from just root@localhost.

I guess that users who care will configure it to be something like 'ovirt-notifications' and point that address to their ticketing system, so that they can reply and track issues. The address does not need to be local, or related to the machine the mail is sent from. I think allowing "real names" will complicate parsing, might lead to new bugs etc., and is not really needed. Most similar notifiers I have used in the past did not allow that either.

Comment 1 Sandro Bonazzola 2013-11-20 10:29:28 UTC
Merged on upstream master, pushed to 1.0 branch.

Comment 2 Sandro Bonazzola 2013-11-20 10:36:51 UTC
Merged also on upstream 1.0 branch, waiting acks for porting this downstream.

Comment 4 Charlie 2013-11-28 01:19:39 UTC
This bug is currently attached to errata RHBA-2013:15257. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to 
minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag.

Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information:

* Cause: What actions or circumstances cause this bug to present.
* Consequence: What happens when the bug presents.
* Fix: What was done to fix the bug.
* Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore')

Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug.

For further details on the Cause, Consequence, Fix, Result format please refer to:

https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes 

Thanks in advance.

Comment 5 Sandro Bonazzola 2013-12-05 11:02:25 UTC
hosted engine is a new package, does not need errata for specific bugs during its development.

Adding flag for release note, since I think this feature should be documented there.

Comment 6 errata-xmlrpc 2014-01-21 16:55:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0083.html