FreeBSD Startup Script

Edit the file:
/etc/rc.conf

Add the line:

milter_greylist_enable="YES"

Create the startup script:
/usr/local/etc/rc.d/milter-greylist.sh

with the following code: (Verify paths!!)

#!/bin/sh
#
#

# PROVIDE: milter-greylist
# REQUIRE: LOGIN
# BEFORE: mail
# KEYWORD: FreeBSD shutdown

#
# Add the following lines to /etc/rc.conf to enable milter_greylist:
#
#milter_greylist_enable="YES"
#
#

. /usr/local/etc/rc.subr

name=milter_greylist
rcvar=`set_rcvar`

command=/usr/local/bin/milter-greylist
pidfile=/var/run/greylist/milter-greylist.pid
user=smmsp
required_files=/etc/mail/greylist.conf

stop_postcmd=stop_postcmd

stop_postcmd()
{
  rm -f $pidfile
}

# set defaults
milter_greylist_delay=${milter_greylist_delay:-"8m"}
milter_greylist_enable=${milter_greylist_enable:-"NO"}
milter_greylist_socket=${milter_greylist_socket:-"/var/run/greylist/milter-greyl
ist.sock"}
milter_greylist_flags=${milter_greylist_flags:-"-P ${pidfile} -u ${user} -p ${mi
lter_greylist_socket} -w ${milter_greylist_delay}"}

load_rc_config $name
run_rc_command "$1"
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License