1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#! /bin/sh
set -e
printandrun()
{
echo "$@"
"$@"
}
printandexpectfail()
{
echo "[SHOULD FAIL] $@"
if "$@" ; then
echo "command should have failed"
exit 1
else
true
fi
}
printandrun \
./swaks -s localhost -tlso -f '<>' -t postmaster@localhost -q rcpt
printandrun \
./swaks -tls -f '<>' \
-t swaks@packages.debian.org -q ehlo
# Cannot check positive tls-cert verification against Debian servers
# since Debian SMTP SSL certs are not trusted by ca-certificates.
printandexpectfail \
./swaks -tls --tls-verify --tls-ca-path `pwd` -f '<>' \
-t swaks@packages.debian.org -q ehlo
|