diff --git a/bin/vmail-aliases-add.sh b/bin/vmail-aliases-add.sh index badcb95..9ea6f7b 100755 --- a/bin/vmail-aliases-add.sh +++ b/bin/vmail-aliases-add.sh @@ -41,7 +41,7 @@ if [ -n "$2" ]; then elif [ -z $domain ] ; then echo "ERROR: No domain in $email." 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." exit 1 fi