2004-09-02 00:11:21 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: postgrey
|
|
|
|
# REQUIRE: LOGIN
|
|
|
|
# BEFORE: mail
|
2006-02-20 21:47:50 +01:00
|
|
|
# KEYWORD: shutdown
|
2004-09-02 00:11:21 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Add the following lines to /etc/rc.conf to enable postgrey:
|
|
|
|
#
|
|
|
|
# postgrey_enable="YES"
|
|
|
|
#
|
|
|
|
# See perldoc postgrey for flags
|
|
|
|
#
|
|
|
|
|
2010-03-27 01:15:24 +01:00
|
|
|
. /etc/rc.subr
|
2004-09-02 00:11:21 +02:00
|
|
|
|
|
|
|
name=postgrey
|
|
|
|
rcvar=`set_rcvar`
|
|
|
|
|
|
|
|
command=%%PREFIX%%/sbin/postgrey
|
|
|
|
required_dirs=/var/db/postgrey
|
2004-09-23 04:07:36 +02:00
|
|
|
extra_commands=reload
|
2004-09-02 00:11:21 +02:00
|
|
|
|
|
|
|
stop_postcmd=stop_postcmd
|
|
|
|
|
|
|
|
stop_postcmd()
|
|
|
|
{
|
|
|
|
rm -f $pidfile
|
|
|
|
}
|
|
|
|
|
|
|
|
# set defaults
|
|
|
|
|
2010-01-18 01:14:21 +01:00
|
|
|
load_rc_config $name
|
|
|
|
|
2004-09-02 00:11:21 +02:00
|
|
|
postgrey_enable=${postgrey_enable:-"NO"}
|
2010-08-18 01:52:34 +02:00
|
|
|
postgrey_greylist_header=${postgrey_greylist_header:-"X-Greylist: delayed %t seconds by postgrey-%v at %h\; %d"}
|
2004-09-02 00:11:21 +02:00
|
|
|
postgrey_pidfile=${postgrey_pidfile:-"/var/run/postgrey.pid"}
|
|
|
|
postgrey_flags=${postgrey_flags:-"--pidfile=${postgrey_pidfile} \
|
2010-08-18 01:52:34 +02:00
|
|
|
--inet=10023 -d --user=%%USER%% --group=%%GROUP%% --dbdir=/var/db/postgrey \
|
|
|
|
--x-greylist-header=${postgrey_greylist_header}"}
|
2004-09-02 00:11:21 +02:00
|
|
|
|
|
|
|
pidfile="${postgrey_pidfile}"
|
|
|
|
|
|
|
|
run_rc_command "$1"
|