blob: 345e1d000960f3c5fc0e37b0bda1164ceb18f5a5 (
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
#!/bin/bash
# $Header: /var/cvsroot/gentoo-x86/mail-mta/netqmail/files/qmail-config-system,v 1.1 2006/02/12 18:42:33 hansmi Exp $
# This is a configuration system to make using and controlling the interesting
# parts of the qmail behavior simple. The only variable that needs to be set
# before running this is $SERVICE.
# this is to inherit QMAIL_CONTROLDIR
. /etc/profile
# now run
# grab the common configuration
[[ -s ${QMAIL_CONTROLDIR}/conf-common ]] && \
. ${QMAIL_CONTROLDIR}/conf-common
# grab the per-service configuration
[[ -s ${QMAIL_CONTROLDIR}/conf-${SERVICE}d ]] && \
. ${QMAIL_CONTROLDIR}/conf-${SERVICE}d
# special case for qmail-send
[[ "${SERVICE}" = send && -s ${QMAIL_CONTROLDIR}/conf-send ]] && \
. ${QMAIL_CONTROLDIR}/conf-send
# you may want to disable this at some point, so I give you the choice here
if [[ -z "${QMAIL_DISABLE_SANITY_CHECK}" ]]
then
# This is intended solely to stop qmail eating up all your hard disk space with logs
CONFIG_SANITY_GOOD=
# check simple stuff first
if [[ -z "${QMAILDUID}" || -z "${NOFILESGID}" || -z "${SERVICE}" || -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}" || -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 &&
! -f ${QMAIL_CONTROLDIR}/rcpthosts &&
-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 && ! -f "${TCPSERVER_RULESCDB}" ]]
then
echo "No CDB file found (${TCPSERVER_RULESCDB})"
CONFIG_SANITY_GOOD=0
fi
if [[ -n "${CONFIG_SANITY_GOOD}" ]]
then
echo "Some error detected in ${SERVICE}, sleeping for 90 seconds for safety"
sleep 90s
exit 1
fi
else
echo "Failed to find sanity checker!"
sleep 30s
exit 1
fi
|