Bug 1065269

Summary: Configuration of email notifications doesn't accept valid address
Product: [Retired] oVirt Reporter: G. Bersano <giorgio.bersano>
Component: ovirt-hosted-engine-setupAssignee: Sandro Bonazzola <sbonazzo>
Status: CLOSED CURRENTRELEASE QA Contact: Jiri Belka <jbelka>
Severity: high Docs Contact:
Priority: high    
Version: 3.4CC: acathrow, bugs, didi, gklein, gpadgett, iheim, msivak, talayan, yeylon
Target Milestone: ---Keywords: Patch, UserExperience
Target Release: 3.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: integration
Fixed In Version: ovirt-3.4.0-beta3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-31 12:28:44 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:

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