Red Hat Bugzilla – Bug 1030437
RFE: Configuration of email notifications
Last modified: 2014-02-05 00:43:25 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:
destination_emails=root@localhost "Martin Sivak <email@example.com>" "John 'Master' Doe <firstname.lastname@example.org>"
There will be other sections in that file as well and those need to be kept intact for now.
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.
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_.-]+' -
Also, do we want to allow to filter sending these emails based on e.g. severity or something like that?
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.
(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 'email@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.
Merged on both master and 1.0 branches.
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)
rc build done, moving to ON_QA, packages will be available on updates-testing repository.
oVirt 3.3.2 has been released resolving the problem described in this bug report.