#!/bin/sh
# $Id: common.sh,v 1.35 2007/05/07 21:39:14 ca Exp $
# Copyright (c) 2004-2006 Sendmail, Inc. and its suppliers.
# All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
# ----------------------------------------
# set common variables for test programs
# needs: SD
# ----------------------------------------
# paths etc for various (test) programs
DEFEDB=defedb
IBDBDIR='ibdb/ibdb'
IBDB='ibd00*'
SMTPCSOCK=qmsmtpc/qmsmtpc
SMARSOCK="qmsmar/qmsmar"
# path to CDB for lmtp sink (smtps3)
LMTPDIR="lmtpdir/"
# some filenames for the sinks
B1=lmtpdir/1/S000000000000000100
B2=lmtpdir/2/S000000000000000200
B3=lmtpdir/3/S000000000000000300
S1=smtpdir/1/S000000000000000100
S2=smtpdir/2/S000000000000000200
S3=smtpdir/3/S000000000000000300
S4=smtpdir/4/S000000000000000400
# port numbers to use
SNKPORT=${MTA_SNKPORT:-8753}
SRVPORT=${MTA_SRVPORT:-1579}
# some logfile names
SRVL="sink.log"
LMTPL="lmtp.log"
CLTL="source.log"
CLTL2="source2.log"
CLTL3="source3.log"
AML="a0.log"
QML="q0.log"
PML="m0.log"
SCL="c0.log"
SSL="s0.log"
# host on which to listen/to which to send
H=localhost
PIDS=pids
PMIDS=pmids
STE="../statethreads/examples"
EDBR=${EDBR:-../checks/t-edbr-0}
export STE CLTL EDBR H PIDS
#
SMXCNF=smx.conf
MCPCNF=${SMXCNF}
#MCPCNF=mcp.conf
# do not run as root
../libcheck/noroot || exit 1
# get USER
. ${SD}/../check2/user.sh
#
AWK=awk
CAT=cat
DIFF=diff
EGREP=egrep
GREP=grep
SED=sed
# get nameserver
if test X"${MTA_NAMESERVER}" != "X"
then
NS=${MTA_NAMESERVER}
else
NS=`${GREP} '^nameserver' /etc/resolv.conf | head -n1 | sed -e 's/nameserver[ ]*\([0-9][0-9\.]*\).*$/\1/'`
fi
# for debugging on some *BSD; how about others?
#export MALLOC_OPTIONS="J"
DSN_ERR="A mail from you could not be delivered. See below for details."
DSN_DEL="A mail from you has not yet been successfully delivered.
It will be tried again, so you do not need to resend it!
See below for details."
DSN_BOUNCE="A bounce message could not be delivered.
See below for details."
VERBOSE=${MTA_VERBOSE:-false}
MM=../libsmmap/t-mm
IDBR0=../libibdb/t-idbr-0
ALI=aliases
ALIMAP=${ALI}.db
ACC=access
ACCMAP=${ACC}.db
QMGRCONF=qmgr_conf
QMGRCONFMAP=${QMGRCONF}.db
MT=mt
MTMAP=${MT}
#MTMAP=${MT}.db
#XREF
SMTP_R_QUICK=0x00010000
#XREF
PMEXIT=999
SHELL=/bin/sh
test -x /bin/ksh && SHELL=/bin/ksh
ERRS=0
ERR=false
ERRORPAT="'ERROR|FATAL|CRIT|ALERT'"
FATALPAT="'FATAL|CRIT|ALERT'"
SRC=${SD}/../smar/common.sh
if test -x ${SRC}
then
. ${SRC}
fi
OUT=tmp.$$
rm -f ${OUT}
../qmgr/qmgr -VVV > ${OUT} 2>/dev/null
if ${GREP} 'QMGR_TEST_NO_AQUPDATE' ${OUT} >/dev/null
then
echo "$0: smtps compiled with QMGR_TEST_NO_AQUPDATE: tests cannot work"
exit 0
else
rm -f ${OUT}
fi
syntax highlighted by Code2HTML, v. 0.9.1