From e10af0b764fb2d042c6ad730866af508f231c8cb Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Mon, 20 Feb 2012 13:40:13 +0100 Subject: Ease zonemgr restrictions Admin e-mail validator currently requires an email to be in a second-level domain (hostmaster@example.com). This is too restrictive. Top level domain e-mails (hostmaster@testrelm) should also be allowed. This patch also fixes default zonemgr value in help texts and man pages. https://fedorahosted.org/freeipa/ticket/2272 --- ipalib/util.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'ipalib/util.py') diff --git a/ipalib/util.py b/ipalib/util.py index 365dd339..eb6702dc 100644 --- a/ipalib/util.py +++ b/ipalib/util.py @@ -231,6 +231,8 @@ def validate_zonemgr(zonemgr): local_part, dot, domain = zonemgr.partition('@') if not regex_local_part.match(local_part): raise ValueError(local_part_errmsg) + if not domain: + raise ValueError(_('missing address domain')) elif zonemgr.count('@') > 1: raise ValueError(_('too many \'@\' characters')) else: @@ -238,8 +240,7 @@ def validate_zonemgr(zonemgr): if last_fake_sep != -1: # there is a 'fake' local-part/domain separator sep = zonemgr.find('.', last_fake_sep+2) if sep == -1: - raise ValueError(_('address domain is not fully qualified ' \ - '("example.com" instead of just "example")')) + raise ValueError(_('missing address domain')) local_part = zonemgr[:sep] domain = zonemgr[sep+1:] @@ -251,10 +252,6 @@ def validate_zonemgr(zonemgr): if not regex_local_part.match(local_part): raise ValueError(local_part_errmsg) - if '.' not in domain: - raise ValueError(_('address domain is not fully qualified ' \ - '("example.com" instead of just "example")')) - if not all(regex_domain.match(part) for part in domain.split(".")): raise ValueError(_('domain name may only include letters, numbers, and -')) -- cgit