Bug 1030437 - RFE: Configuration of email notifications
Summary: RFE: Configuration of email notifications
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-hosted-engine-setup
Version: 3.3
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: ---
: 3.4.0
Assignee: Yedidyah Bar David
QA Contact: Leonid Natapov
URL:
Whiteboard: integration
Depends On:
Blocks: 1032467
TreeView+ depends on / blocked
 
Reported: 2013-11-14 12:57 UTC by Martin Sivák
Modified: 2014-02-05 05:43 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Feature: Configuration of email notifications Reason: Needed by HA daemon Result (if any):
Clone Of:
: 1032467 (view as bug list)
Environment:
Last Closed: 2013-12-19 14:24:33 UTC
oVirt Team: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 21415 0 None None None Never
oVirt gerrit 21451 0 None None None Never

Description Martin Sivák 2013-11-14 12:57:57 UTC
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.

Comment 1 Sandro Bonazzola 2013-11-14 13:07:19 UTC
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.

Comment 2 Yedidyah Bar David 2013-11-18 09:29:46 UTC
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?

Comment 3 Martin Sivák 2013-11-18 09:42:31 UTC
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.

Comment 4 Yedidyah Bar David 2013-11-18 10:26:01 UTC
(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 5 Sandro Bonazzola 2013-11-20 10:35:44 UTC
Merged on both master and 1.0 branches.

Comment 6 Pablo Iranzo Gómez 2013-11-27 12:47:52 UTC
Next point in using email notifications is allowing authentication.... some ISP's require SMTP to use AUTH before sending ;)

(but you can always use localhost and make postfix/sendmail take care of that part)

Regards

Comment 7 Sandro Bonazzola 2013-12-13 16:02:01 UTC
rc build done, moving to ON_QA, packages will be available on updates-testing repository.

Comment 8 Sandro Bonazzola 2013-12-19 14:24:33 UTC
oVirt 3.3.2 has been released resolving the problem described in this bug report.


Note You need to log in before you can comment on or make changes to this bug.