diff --git a/tests/test_send_email.sh b/tests/test_send_email.sh
index d60357cb3ecef1fbe78a630ae6540571ba973b3e..1ec62e16069d946cc8cb2fb415dae967ac29620f 100755
--- a/tests/test_send_email.sh
+++ b/tests/test_send_email.sh
@@ -7,7 +7,7 @@ echo "Sending email to $EMAIL"
 echo "This is a test email" | mail -s "Test email from `cat /etc/hostname`" $EMAIL
 sleep 10
 grep $EMAIL /var/log/mail.log | grep bounced > /dev/null
-if [ $? -ne 0 ]; then
+if [ $? -e 0 ]; then
     echo "Sending mail failed"
     exit 1
 fi