switched to validate_domain function

This commit is contained in:
Matthew Saunders Brown 2021-02-16 10:01:55 -08:00
parent 5ffaff2c96
commit a95e6fec83

View File

@ -41,7 +41,7 @@ if [ -n "$2" ]; then
elif [ -z $domain ] ; then elif [ -z $domain ] ; then
echo "ERROR: No domain in $email." echo "ERROR: No domain in $email."
exit 1 exit 1
elif [[ ! $domain =~ ^(([a-zA-Z](-?[a-zA-Z0-9])*)\.)+[a-zA-Z]{2,}$ ]] ; then elif ! vmail::validate_domain $domain; then
echo "ERROR: $domain is not a valid domain name." echo "ERROR: $domain is not a valid domain name."
exit 1 exit 1
fi fi