finetuning the server side email check
This commit is contained in:
@@ -12,7 +12,7 @@ hostPart=${mail/*@/}
|
|||||||
if [ hostPart != "localhost" ]
|
if [ hostPart != "localhost" ]
|
||||||
then host=$(dig +short $hostPart MX | sort -n | head -n1 | cut -d " " -f 2)
|
then host=$(dig +short $hostPart MX | sort -n | head -n1 | cut -d " " -f 2)
|
||||||
if [ -z ${host} ]
|
if [ -z ${host} ]
|
||||||
then echo -e "{status:'err', error:'Unknown mail host'}"
|
then echo -e "{\"status\":\"err\", \"error\":\"Unknown mail host\"}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@@ -40,9 +40,9 @@ EOE
|
|||||||
|
|
||||||
if [ -z "${result}" ]
|
if [ -z "${result}" ]
|
||||||
then echo "OK : " $mail >> /dev/null # $logfile
|
then echo "OK : " $mail >> /dev/null # $logfile
|
||||||
echo -e "{'status':'ok'}"
|
echo -e "{\"status\":\"ok\"}"
|
||||||
exit 0
|
exit 0
|
||||||
else echo $mail ":" $result >> /dev/null # $logfile
|
else echo $mail ":" $result >> /dev/null # $logfile
|
||||||
echo -e "{'status':'err', error:'Unknown User'}"
|
echo -e "{\"status\":\"err\", \"error\":\"Unknown User\"}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ function checkEMail(theEmailAddress){
|
|||||||
data: { "mailAddress" : theEmailAddress},
|
data: { "mailAddress" : theEmailAddress},
|
||||||
success:function(msg,jqXHR,status) {
|
success:function(msg,jqXHR,status) {
|
||||||
console.log("send-success method mailcheck ",msg,jqXHR,status);
|
console.log("send-success method mailcheck ",msg,jqXHR,status);
|
||||||
if (msg.status != "ok") {
|
if (msg.status === "ok") {
|
||||||
def.resolve();
|
def.resolve();
|
||||||
} else {
|
} else {
|
||||||
def.reject(msg);
|
def.reject(msg);
|
||||||
|
|||||||
Reference in New Issue
Block a user