Bug 1030437 - RFE: Configuration of email notifications
RFE: Configuration of email notifications
Status: CLOSED NEXTRELEASE
Product: oVirt
Classification: Community
Component: ovirt-hosted-engine-setup (Show other bugs)
3.3
Unspecified Unspecified
high Severity low
: ---
: 3.4.0
Assigned To: Yedidyah Bar David
Leonid Natapov
integration
: Triaged
Depends On:
Blocks: 1032467
  Show dependency treegraph
 
Reported: 2013-11-14 07:57 EST by Martin Sivák
Modified: 2014-02-05 00:43 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Feature: Configuration of email notifications Reason: Needed by HA daemon Result (if any):
Story Points: ---
Clone Of:
: 1032467 (view as bug list)
Environment:
Last Closed: 2013-12-19 09:24:33 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 21415 None None None Never
oVirt gerrit 21451 None None None Never

  None (edit)
Description Martin Sivák 2013-11-14 07:57:57 EST
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@redhat.com>" "John 'Master' Doe <john@doe.com>"

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 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.
Comment 2 Yedidyah Bar David 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@example.com

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 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.
Comment 4 Yedidyah Bar David 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@example.com' 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 05:35:44 EST
Merged on both master and 1.0 branches.
Comment 6 Pablo Iranzo Gómez 2013-11-27 07:47:52 EST
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 11:02:01 EST
rc build done, moving to ON_QA, packages will be available on updates-testing repository.
Comment 8 Sandro Bonazzola 2013-12-19 09:24:33 EST
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.