summaryrefslogtreecommitdiff
path: root/mail/postgrey/files/postgrey.in
blob: bf8431667bd6cbaa9118c8a172b50dec3fda4b79 (plain) (blame)
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
#!/bin/sh
# $FreeBSD$
#

# PROVIDE: postgrey
# REQUIRE: LOGIN
# BEFORE: mail
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable postgrey:
#
# postgrey_enable="YES"
#
# See perldoc postgrey for flags
#

. /etc/rc.subr

name=postgrey
rcvar=`set_rcvar`

command=%%PREFIX%%/sbin/postgrey
required_dirs=/var/db/postgrey
extra_commands=reload

stop_postcmd=stop_postcmd

stop_postcmd()
{
  rm -f $pidfile
}

# set defaults

load_rc_config $name

postgrey_enable=${postgrey_enable:-"NO"}
postgrey_pidfile=${postgrey_pidfile:-"/var/run/postgrey.pid"}
postgrey_flags=${postgrey_flags:-"--pidfile=${postgrey_pidfile} \
	--inet=10023 -d --user=%%USER%% --group=%%GROUP%% --dbdir=/var/db/postgrey"}

pidfile="${postgrey_pidfile}"

run_rc_command "$1"