Bug 1109169 - [Admin Portal] root@localhost is not accepted as valid mail for event notifications
Summary: [Admin Portal] root@localhost is not accepted as valid mail for event notific...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-webadmin
Version: 3.5
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 3.5.0
Assignee: Mooli Tayer
QA Contact: Pavel Stehlik
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-13 11:52 UTC by Jiri Belka
Modified: 2016-02-10 19:31 UTC (History)
9 users (show)

Fixed In Version: ovirt-engine-3.5.0_beta
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-17 12:24:28 UTC
oVirt Team: Infra
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 28742 0 master MERGED core: replace regexp validation for user email. Never

Description Jiri Belka 2014-06-13 11:52:42 UTC
Description of problem:
root@localhost is not accepted as valid mail for event notifications. sorry but this is wrong. engine is too clever where it should not be.

it works via `mail' command:

>N  1 PostgreSQL Server     Fri Jun 13 13:47  18/763   "testovic"
& 1
Message  1:
From postgres.lab.eng.brq.redhat.com  Fri Jun 13 13:47:34 2014
Return-Path: <postgres.lab.eng.brq.redhat.com>
X-Original-To: root@localhost
Delivered-To: root.lab.eng.brq.redhat.com
Date: Fri, 13 Jun 2014 13:47:34 +0200
To: root.lab.eng.brq.redhat.com
Subject: testovic
User-Agent: Heirloom mailx 12.4 7/29/08
Content-Type: text/plain; charset=us-ascii
From: postgres.lab.eng.brq.redhat.com (PostgreSQL Server)
Status: R

cus bus autobus

Thus, re-think if being too clever makes sense while checking mail address.

Version-Release number of selected component (if applicable):
ovirt-engine-webadmin-portal-3.5.0-0.0.master.20140605145557.git3ddd2de.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. root@localhost for a event, click OK
2. not saved in the DB, not visible in UI
3.

Actual results:
root@localhost not accepted

Expected results:
should work

Additional info:

Comment 1 Mooli Tayer 2014-06-15 07:19:00 UTC
When a user attempts to register in the UI,
in EventSubscriptionCommandBase we use this ad hook regexp:
^[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$

when emails are registered through config files we do 
new InternetAddress(recipient) and we do that only upon send attempt
and not registration. 

I think we should validate in the UI using more then what InternetAddress() gives (even when using the strict form this does not enforce domain according to javadoc) Maybe we can use:

^[\w-]+(?:\.[\w-]+)*@[\w-]+(?:\.[a-zA-Z]{2,7})?$

Comment 2 Mooli Tayer 2014-06-15 08:12:48 UTC
After testing I see that InternetAddress("kuku", true) does validate a domain:
Missing final '@domain' in string ``kuku'' 

So that should be enough.

Comment 3 Mooli Tayer 2014-06-26 12:51:41 UTC
In constrast to my previous comment strict InternetAddress validation does
not allow simple names so that was used here.

'root@localhost' should now be accepted through the UI.
'root' should not.

Comment 4 Jiri Belka 2014-07-14 12:12:29 UTC
ok, ovirt-engine-3.5.0-0.0.master.20140629172257.git0b16ed7.el6.noarch

engine=# select * from event_subscriber ;
            subscriber_id             | event_up_name | method_address | tag_name | notification_method 
--------------------------------------+---------------+----------------+----------+---------------------
 fdfc627c-d875-11e0-90f0-83df133b58cc | VDS_FAILURE   | root@localhost |          | smtp
(1 row)

Comment 5 Sandro Bonazzola 2014-10-17 12:24:28 UTC
oVirt 3.5 has been released and should include the fix for this issue.


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