Skip to content

Commit d231714

Browse files
committed
simple email validator
1 parent 7d6cadc commit d231714

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

func/main.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -613,14 +613,7 @@ validate_format_ip_status() {
613613

614614
# Email address
615615
validate_format_email() {
616-
local_part=$(echo $1 | cut -s -f1 -d\@)
617-
remote_host=$(echo $1 | cut -s -f2 -d\@)
618-
mx_failed=1
619-
if [ ! -z "$remote_host" ] && [ ! -z "$local_part" ]; then
620-
/usr/bin/host -t mx "$remote_host" &> /dev/null
621-
mx_failed="$?"
622-
fi
623-
if [ "$mx_failed" -eq 1 ]; then
616+
if [[ ! "$1" =~ "@" ]] ; then
624617
echo "Error: email $1 is not valid"
625618
log_event "$E_INVALID" "$EVENT"
626619
exit $E_INVALID

0 commit comments

Comments
 (0)