fixing the serverside e-mail checking

This commit is contained in:
WebMaster
2017-02-08 00:00:54 -05:00
parent f5e1367e57
commit 7f597c5f98
2 changed files with 8 additions and 6 deletions

View File

@@ -1,3 +1,5 @@
<?php <?php
echo shell_exec('./checkmail.sh \'' . $_GET['mailAddress'] . '\''); $mailAddress=$_GET['mailAddress'];
$output=shell_exec(__DIR__ . '/checkMail.sh \'' . $mailAddress . '\'');
echo $output;
?> ?>

10
checkMail.sh Normal file → Executable file
View File

@@ -4,7 +4,7 @@
testhost=webthink.net testhost=webthink.net
testuser=webmaster@${testhost} testuser=webmaster@${testhost}
logfile=~/mailqueryfail.log #logfile=~/mailqueryfail.log
mail=$1 mail=$1
hostPart=${mail/*@/} hostPart=${mail/*@/}
@@ -39,10 +39,10 @@ EOE
) | expect -f - | grep -e '^5') ) | expect -f - | grep -e '^5')
if [ -z "${result}" ] if [ -z "${result}" ]
then echo "OK : " $mail >> $logfile then echo "OK : " $mail >> /dev/null # $logfile
echo -e "{status:'ok'}" echo -e "{'status':'ok'}"
exit 0 exit 0
else echo $mail ":" $result >> $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