PR: ports/148707 Submitted by: Sunpoet Po-Chuan Hsieh <sunpoet@sunpoet.net> Reviewed by: maintainer timeout (1 month)
47 lines
927 B
Bash
47 lines
927 B
Bash
#!/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_greylist_header=${postgrey_greylist_header:-"X-Greylist: delayed %t seconds by postgrey-%v at %h\; %d"}
|
|
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 \
|
|
--x-greylist-header=${postgrey_greylist_header}"}
|
|
|
|
pidfile="${postgrey_pidfile}"
|
|
|
|
run_rc_command "$1"
|