mail log fine tuning
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
testhost=webthink.net
|
testhost=webthink.net
|
||||||
testuser=webmaster@${testhost}
|
testuser=webmaster@${testhost}
|
||||||
logfile=~/checkMailQueryfail.log
|
logfile=./checkMailQueryfail.log
|
||||||
|
|
||||||
mail=$1
|
mail=$1
|
||||||
hostPart=${mail/*@/}
|
hostPart=${mail/*@/}
|
||||||
@@ -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 hosti.\"}"
|
then echo -e "{\"status\":\"err\", \"error\":\"Unknown mail host.\"}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user