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 (bool) Set to 'YES' to enable |
|
|
13 |
# Default: NO |
14 |
# postgrey_dbdir (path) Location of postgrey database files. |
15 |
# Default: /var/db/postgrey |
16 |
# postgrey_flags (extra args) Additional command-line parameters. |
17 |
# Default: --inet=10023 |
14 |
# |
18 |
# |
15 |
# See perldoc postgrey for flags |
19 |
# Note: |
16 |
# |
20 |
# |
|
|
21 |
# postgrey_flags must include a --inet or --unix option or postgrey will |
22 |
# not run. Change the --dbdir option with postgrey_dbdir. Please see |
23 |
# the postgrey(1) man page or perldoc postgrey for more information. |
17 |
|
24 |
|
18 |
. /etc/rc.subr |
25 |
. /etc/rc.subr |
19 |
|
26 |
|
20 |
name=postgrey |
27 |
name=postgrey |
21 |
rcvar=postgrey_enable |
|
|
22 |
|
28 |
|
23 |
command=%%PREFIX%%/sbin/postgrey |
29 |
load_rc_config $name |
24 |
required_dirs=/var/db/postgrey |
|
|
25 |
extra_commands=reload |
26 |
|
30 |
|
27 |
stop_postcmd=stop_postcmd |
31 |
: ${postgrey_enable:=NO} |
|
|
32 |
: ${postgrey_dbdir:=/var/db/postgrey} |
33 |
: ${postgrey_flags:=--inet=10023} |
28 |
|
34 |
|
29 |
stop_postcmd() |
35 |
command=%%PREFIX%%/sbin/postgrey |
30 |
{ |
36 |
pidfile=/var/run/postgrey.pid |
31 |
rm -f $pidfile |
37 |
required_dirs=${postgrey_dbdir} |
32 |
} |
|
|
33 |
|
38 |
|
34 |
# set defaults |
39 |
command_args="-d --pidfile=${pidfile} --dbdir=${postgrey_dbdir}" |
35 |
|
40 |
|
36 |
load_rc_config $name |
41 |
stop_postcmd="rm -f ${pidfile}" |
37 |
|
42 |
|
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" |
43 |
run_rc_command "$1" |