Lines 7-47
Link Here
|
7 |
# BEFORE: mail |
7 |
# BEFORE: mail |
8 |
# KEYWORD: shutdown |
8 |
# KEYWORD: shutdown |
9 |
|
9 |
|
10 |
# |
|
|
11 |
# Add the following lines to /etc/rc.conf to enable postgrey: |
10 |
# Add the following lines to /etc/rc.conf to enable postgrey: |
12 |
# |
11 |
# |
13 |
# postgrey_enable="YES" |
12 |
# postgrey_enable="YES" |
14 |
# |
13 |
# |
15 |
# See perldoc postgrey for flags |
14 |
# You must specify listening on a TCP socket (--inet option) or |
|
|
15 |
# unix socket (--unix) in postgrey_flags: |
16 |
# |
16 |
# |
|
|
17 |
# postgrey_flags="--inet=PORT" |
18 |
# |
19 |
# -OR- |
20 |
# |
21 |
# postgrey_flags="--unix=/path/to/socket" |
22 |
# |
23 |
# By default, postgrey uses /var/db/postgrey for its databases. |
24 |
# You can change this location using the postgrey_dbdir option. |
25 |
# |
26 |
# You can set extra command-line flags in postgrey_flags as well. |
27 |
# See the postgrey(1) man page or perldoc postgrey for options. |
17 |
|
28 |
|
18 |
. /etc/rc.subr |
29 |
. /etc/rc.subr |
19 |
|
30 |
|
20 |
name=postgrey |
31 |
name=postgrey |
21 |
rcvar=postgrey_enable |
|
|
22 |
|
32 |
|
|
|
33 |
load_rc_config $name |
34 |
|
35 |
: ${postgrey_enable:=NO} |
36 |
: ${postgrey_dbdir:=/var/db/postgrey} |
37 |
: ${postgrey_flags:=--inet=10023} |
38 |
|
23 |
command=%%PREFIX%%/sbin/postgrey |
39 |
command=%%PREFIX%%/sbin/postgrey |
24 |
required_dirs=/var/db/postgrey |
40 |
pidfile=/var/run/postgrey.pid |
|
|
41 |
required_dirs=${postgrey_dbdir} |
25 |
extra_commands=reload |
42 |
extra_commands=reload |
26 |
|
43 |
|
27 |
stop_postcmd=stop_postcmd |
44 |
postgrey_flags="-d --pidfile=${pidfile} --dbdir=${postgrey_dbdir} ${postgrey_flags}" |
28 |
|
45 |
|
29 |
stop_postcmd() |
46 |
stop_postcmd="rm -f $pidfile" |
30 |
{ |
|
|
31 |
rm -f $pidfile |
32 |
} |
33 |
|
47 |
|
34 |
# set defaults |
|
|
35 |
|
36 |
load_rc_config $name |
37 |
|
38 |
postgrey_enable=${postgrey_enable:-"NO"} |
39 |
postgrey_greylist_header=${postgrey_greylist_header:-"X-Greylist: delayed %t seconds by postgrey-%v at %h\; %d"} |
40 |
postgrey_pidfile=${postgrey_pidfile:-"/var/run/postgrey.pid"} |
41 |
postgrey_flags=${postgrey_flags:-"--pidfile=${postgrey_pidfile} \ |
42 |
--inet=10023 -d --user=%%USER%% --group=%%GROUP%% --dbdir=/var/db/postgrey \ |
43 |
--x-greylist-header=${postgrey_greylist_header}"} |
44 |
|
45 |
pidfile="${postgrey_pidfile}" |
46 |
|
47 |
run_rc_command "$1" |
48 |
run_rc_command "$1" |