Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 100733 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/portage/mail-filter/postgrey/files/postgrey.conf (+12 lines)
Lines 4-18 Link Here
4
4
5
# Config file for /etc/init.d/postgrey
5
# Config file for /etc/init.d/postgrey
6
6
7
# TYPE
8
#  Do you want inet or unix socket version ?
9
POSTGREY_TYPE="unix"
10
11
# SOCKET
12
#  Which socket do you want to bind ?
13
#  (ignored if inet type)
14
#
15
POSTGREY_SOCKET="/var/spool/postfix/private/postgrey"
7
16
8
# HOST
17
# HOST
9
#  What IP to listen to?
18
#  What IP to listen to?
10
#  Leave to localhost unless you know what you do.
19
#  Leave to localhost unless you know what you do.
20
#  (ignored if socket type)
21
#
11
POSTGREY_HOST="127.0.0.1"
22
POSTGREY_HOST="127.0.0.1"
12
23
13
24
14
# PORT
25
# PORT
15
#  What PORT to listen to?
26
#  What PORT to listen to?
27
#  (ignored if socket type)
16
#
28
#
17
POSTGREY_PORT="10030"
29
POSTGREY_PORT="10030"
18
30
(-)/usr/portage/mail-filter/postgrey/files/postgrey.rc (-6 / +39 lines)
Lines 9-31 Link Here
9
	provide postfix_greylist
9
	provide postfix_greylist
10
}
10
}
11
11
12
conf_error() {
13
	eerror "You need to setup variables in /etc/conf.d/postgrey first"
14
	return 1
15
}
16
12
checkconfig() {
17
checkconfig() {
13
if [ -z "${POSTGREY_PORT}" ] || [ -z "${POSTGREY_HOST}" ] || [ -z "${POSTGREY_PID}" ]
18
if [ -z "${POSTGREY_TYPE}" ]
14
	then
19
	then
20
		einfo "You need to choose the server type you want"
21
		einfo "by setting the TYPE variable."
22
	else
23
	if [ "x${POSTGREY_TYPE}" = "xinet" ]
24
		then
25
			if [ -z "${POSTGREY_PORT}" ] || [ -z "${POSTGREY_HOST}" ]
26
				then
27
					einfo "The following entries are missing in /etc/conf.d/postgrey:"
28
					[ -z "${POSTGREY_HOST}" ] && einfo "  - POSTGREY_HOST"
29
					[ -z "${POSTGREY_PORT}" ] && einfo "  - POSTGREY_PORT"
30
					conf_error
31
			fi
32
			POSTGREY_CONF="${POSTGREY_TYPE}=${POSTGREY_HOST}:${POSTGREY_PORT}"
33
		else
34
			if [ -z "${POSTGREY_SOCKET}" ]
35
			then
36
				einfo "The following entries are missing in /etc/conf.d/postgrey: POSTGREY_SOCKET"
37
				conf_error
38
			fi
39
			POSTGREY_CONF="${POSTGREY_TYPE}=${POSTGREY_SOCKET}"
40
	fi
41
fi
42
43
	if [ -z "${POSTGREY_PID}" ]
44
		then
15
		einfo "The following entries are missing in /etc/conf.d/postgrey:"
45
		einfo "The following entries are missing in /etc/conf.d/postgrey:"
16
		[ -z "${POSTGREY_HOST}" ] && einfo "  - POSTGREY_HOST"
17
		[ -z "${POSTGREY_PORT}" ] && einfo "  - POSTGREY_PORT"
18
		[ -z "${POSTGREY_PID}" ] && einfo "  - POSTGREY_PID"
46
		[ -z "${POSTGREY_PID}" ] && einfo "  - POSTGREY_PID"
19
		eerror "You need to setup variables in /etc/conf.d/postgrey first"
47
		conf_error
20
		return 1
21
	fi
48
	fi
22
}
49
}
50
23
start() {
51
start() {
24
	checkconfig || return 1
52
	checkconfig || return 1
25
	ebegin "Starting Postgrey"
53
	ebegin "Starting Postgrey"
54
	
55
	# HACK -- start a subshell and corrects perms on the socket...
56
	( if [ "x${POSTGREY_TYPE}" = "xunix" ]; then
57
	sleep 2 && chmod a+rw,a-x ${POSTGREY_SOCKET}; fi ) &
58
26
	start-stop-daemon --start --quiet --background \
59
	start-stop-daemon --start --quiet --background \
27
		--exec /usr/sbin/postgrey -- \
60
		--exec /usr/sbin/postgrey -- \
28
		--inet=${POSTGREY_HOST}:${POSTGREY_PORT} \
61
		--${POSTGREY_CONF} \
29
		--daemonize \
62
		--daemonize \
30
		--pidfile=${POSTGREY_PID} \
63
		--pidfile=${POSTGREY_PID} \
31
		${POSTGREY_OPTS}
64
		${POSTGREY_OPTS}

Return to bug 100733