Bug 1065269 - Configuration of email notifications doesn't accept valid address
Summary: Configuration of email notifications doesn't accept valid address
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-hosted-engine-setup
Version: 3.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 3.4.0
Assignee: Sandro Bonazzola
QA Contact: Jiri Belka
URL:
Whiteboard: integration
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-14 08:44 UTC by G. Bersano
Modified: 2014-03-31 12:28 UTC (History)
9 users (show)

Fixed In Version: ovirt-3.4.0-beta3
Clone Of:
Environment:
Last Closed: 2014-03-31 12:28:44 UTC
oVirt Team: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 24476 0 None None None Never
oVirt gerrit 24533 0 None None None Never

Description G. Bersano 2014-02-14 08:44:36 UTC
Description of problem:
When requested to input an email address for notifications it's impossible to input an address with an hyphen in the local part.

Version-Release number of selected component (if applicable):
ovirt-hosted-engine-setup-1.1.0-0.5.beta2.el6.noarch

How reproducible:
Always

Steps to Reproduce:
1. # hosted-engine --deploy
2. go until the "HOSTED ENGINE CONFIGURATION" phase, at the question:
Please provide the email address from which notifications will be sent [root@localhost]:
3. type this answer: my-name

Actual results:
[ ERROR ] Invalid input, please try again

Expected results:
Address accepted

Additional info:
Address notifications was an RFE with bugzilla 1030437 .
Looking there at "Comment 2" we can see hypen as a legal character but the real implementation was more restrictive.

I understand this being a sensible topic (and "Internationalized Domain Names" could become a problem in the future) but a more wider choice is needed.

I suggest this little modification i tested myself:

--8<---------------------

*** original/ha_notifications.py	2014-02-06 13:02:04.000000000 +0100
--- enhanced/ha_notifications.py	2014-02-13 13:59:53.549623260 +0100
***************
*** 69,75 ****
      _RE_EMAIL_ADDRESS = re.compile(
          flags=re.VERBOSE,
          pattern=r"""
!             [a-zA-Z0-9_.+]+
              @
              [a-z0-9.-]+
          """
--- 69,76 ----
      _RE_EMAIL_ADDRESS = re.compile(
          flags=re.VERBOSE,
          pattern=r"""
!             [a-zA-Z0-9]
!             [a-zA-Z0-9_.+-=]*
              @
              [a-z0-9.-]+
          """
--------------------->8--

Thank you for taking care of this,
Giorgio.

Comment 1 Sandro Bonazzola 2014-02-14 09:16:05 UTC
(In reply to G. Bersano from comment #0)

> I suggest this little modification i tested myself:

Thanks, pushed to gerrit as-is for review.

Comment 2 Sandro Bonazzola 2014-02-17 07:46:37 UTC
Merged on master and 1.1 branches

Comment 3 G. Bersano 2014-02-21 16:40:19 UTC
Tested in 3.4.0 beta3 and now it works!

Thank you very much,
Giorgio.

Comment 4 Jiri Belka 2014-03-10 14:37:58 UTC
ok, beta3 & av2.1.

...
          Please provide the name of the SMTP server through which we will send notifications [localhost]: 
          Please provide the TCP port number of the SMTP server [25]: 
          Please provide the email address from which notifications will be sent [root@localhost]: my-name
          Please provide a comma-separated list of email addresses which will get notifications [root@localhost]: my-name
[ INFO  ] Stage: Setup validation
...

Comment 5 Sandro Bonazzola 2014-03-31 12:28:44 UTC
this is an automated message: moving to Closed CURRENT RELEASE since oVirt 3.4.0 has been released


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