#!/usr/bin/bash echo "Test encryption for certificate an a keyserver" # There is a certificate for carol on the keyserver # it's certified by an introducer adduser --shell /bin/bash --disabled-password --gecos "" carol echo "test mail" | sendmail carol@example.com sleep 1 if [ -f /var/mail/carol ] ; then if grep -q "BEGIN PGP MESSAGE" /var/mail/carol ; then RESULT_CODE=0 else echo "no encryption detected" RESULT_CODE=1 fi else echo "no mail detected" RESULT_CODE=1 fi deluser --remove-home carol exit $RESULT_CODE