blob: 848d12a2b7c82800a7353422780594f05332c8f2 (
plain)
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
35
36
37
|
#!/bin/sh
# Configuration Sanity Checking for qmail
# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/config-sanity-check,v 1.3 2005/01/10 00:17:34 robbat2 Exp $
# This is intended solely to stop qmail eating up all your hard disk space with logs
CONFIG_SANITY_GOOD=1
# check simple stuff first
if [ -z "${QMAILDUID}" -o -z "${NOFILESGID}" -o -z "${SERVICE}" -o -z "${QMAILLUID}" ]; then
echo "SERVICE(${SERVICE}), QMAILDUID(${QMAILDUID}), NOFILESGID(${NOFILESGID}) or QMAILLUID(${QMAILLUID}) is unset in $0"
CONFIG_SANITY_GOOD=0
fi
if [ -z "${LOG_OPTS}" -o -z "${LOG_DEST}" ]; then
echo "LOG_OPTS: ${LOG_OPTS}"
echo "LOG_DEST: ${LOG_DEST}"
echo "Error in logging setup!"
CONFIG_SANITY_GOOD=0
fi
if [ "${SERVICE}" = "smtp" -a ! -f ${QMAIL_CONTROLDIR}/rcpthosts -a -z "${QMAIL_DISABLE_SANITY_CHECK}" ]; then
echo "No /var/qmail/control/rcpthosts!"
echo "Refusing to start SMTP listener because it'll create an open relay"
CONFIG_SANITY_GOOD=0
fi
if [ "${SERVICE}" != "send" -a ! -f "${TCPSERVER_RULESCDB}" ]; then
echo "No CDB file found (${TCPSERVER_RULESCDB})"
CONFIG_SANITY_GOOD=0
fi
if [ ! "${CONFIG_SANITY_GOOD}" -eq "1" ]; then
echo "Some error detected in ${SERVICE}, sleeping for 90 seconds for safety"
sleep 90s
exit 1
fi
|