#!/bin/sh
# $Id: t-rsad-3.sh,v 1.1 2007/02/11 03:57:38 ca Exp $
#
# ----------------------------------------
# test RSAD in smtpc; "global" status
# run smtp1.sh with different parameters
# ----------------------------------------
#
test -s stop && exit 1
#
SD=`dirname $0`
if test "${SD}" = "."
then
SD=../chkmts
fi
. ${SD}/common.sh
I=""
ERRS=0
OK="t-rsad-3.ok"
OUT="t-rsad-3.out"
EDBROK="t-rsad-3.edbr.ok"
if test X"`uname`" != "XOSF1"
then
while getopts s:V FLAG
do
case "${FLAG}" in
s) SKIP="${SKIP} ${OPTARG}";;
V) VERBOSE=true;;
esac
done
shift `expr ${OPTIND} - 1`
fi
# cd to working directory for alias file!
cd ../qmgr || exit 1
if ../smtpc/smtpc -VVV | ${GREP} MTA_USE_RSAD >/dev/null
then
:
else
echo "SKIPPED: $0: smtpc not compiled with MTA_USE_RSAD"
exit 0
fi
# create aliases
${CAT} > ${ALI} <<EOF
abuse: local:
postmaster: local:
user: local:
sender: local:
EOF
# create map
rm -f ${ALIMAP}
${MM} < ${ALI}
rm -f ${MTMAP}
# run some test programs
# ----------------------------------------
# SMTP sink accepts mail ("global" reply for final dot)
TEST=1
if echo "${SKIP} X" | ${GREP} -v " ${TEST} " > /dev/null
then
ERR=false
cp /dev/null ${EDBROK}
if ${SHELL} ${SD}/smtp1.sh -O ${EDBROK} -3 lmtpsock -Ssender@local.dom -Rd551@local.host -Rd452@local.host -i 10 -E 2 -X 0 -A 1 -s 10 -v 20 -Y '-9 -d 6 -F 250'
then
if test -s ${B1}
then
${VERBOSE} && echo "$0: test ${TEST}: ${B1} exists"
ERR=true
fi
else
${VERBOSE} && echo "$0: test ${TEST}: smtp1.sh failed"
ERR=true
fi
if ${ERR}
then
echo "$0: test ${TEST} failed"
ERRS=`expr ${ERRS} + 1 `
test X"${MTA_STOPONERROR}" != X && exit 1
fi
fi
# ----------------------------------------
# end
if test "${ERRS}" = "0"
then
rm -f ${OK} ${OUT} ${EDBROK}
exit 0
else
echo "${ERRS} error(s)"
exit 1
fi
syntax highlighted by Code2HTML, v. 0.9.1