From 6184c43e753bf5215e306fae8adbb829711310aa Mon Sep 17 00:00:00 2001 From: WebMaster Date: Wed, 8 Feb 2017 00:20:51 -0500 Subject: [PATCH] finetuning the server side email check --- checkMail.sh | 6 +++--- templates/sell_userInfo.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/checkMail.sh b/checkMail.sh index 75a0f68..0bbe769 100755 --- a/checkMail.sh +++ b/checkMail.sh @@ -12,7 +12,7 @@ hostPart=${mail/*@/} if [ hostPart != "localhost" ] then host=$(dig +short $hostPart MX | sort -n | head -n1 | cut -d " " -f 2) if [ -z ${host} ] -then echo -e "{status:'err', error:'Unknown mail host'}" +then echo -e "{\"status\":\"err\", \"error\":\"Unknown mail host\"}" exit 1 fi else @@ -40,9 +40,9 @@ EOE if [ -z "${result}" ] then echo "OK : " $mail >> /dev/null # $logfile - echo -e "{'status':'ok'}" + echo -e "{\"status\":\"ok\"}" exit 0 else echo $mail ":" $result >> /dev/null # $logfile - echo -e "{'status':'err', error:'Unknown User'}" + echo -e "{\"status\":\"err\", \"error\":\"Unknown User\"}" exit 1 fi diff --git a/templates/sell_userInfo.html b/templates/sell_userInfo.html index 5099bfc..33a2f25 100644 --- a/templates/sell_userInfo.html +++ b/templates/sell_userInfo.html @@ -12,7 +12,7 @@ function checkEMail(theEmailAddress){ data: { "mailAddress" : theEmailAddress}, success:function(msg,jqXHR,status) { console.log("send-success method mailcheck ",msg,jqXHR,status); - if (msg.status != "ok") { + if (msg.status === "ok") { def.resolve(); } else { def.reject(msg);