diff options
-rwxr-xr-x | fripost-newdomain | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fripost-newdomain b/fripost-newdomain index b9fcecc..5c4c2fb 100755 --- a/fripost-newdomain +++ b/fripost-newdomain @@ -147,8 +147,12 @@ my $ldap = Fripost::Schema->new( $conf ); my %domain; $domain{domain} = $ARGV[0]; $domain{domain} //= prompt "Domain name: "; -# TODO: Ensure that the domain is valid. $domain{isActive} = 'TRUE'; + +# Ensure that the domain is valid. +Email::Valid->address('test@'.$domain{domain}) + or die "Error: Invalid domain `$domain{domain}'.\n"; + if (defined $conf->{owner}) { if ($conf->{owner} eq '') { $domain{owner} = undef |