summaryrefslogtreecommitdiff
path: root/mail/postfix-postfwd/files/postfwd.in
blob: 19d91864bda51f02e79a8af55cc9e1ca04cb25d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh

# PROVIDE: postfwd 
# REQUIRE: LOGIN cleanvar
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# postfwd_enable (bool):   
#	Set to "NO" by default.
#               Set it to "YES" to enable postfwd.
# postfwd_config (path):   Set to %%PREFIX%%/etc/postfwd.conf
#               by default.
#

. /etc/rc.subr

name=postfwd
rcvar=${name}_enable

command=%%PREFIX%%/bin/${name}
required_files=%%PREFIX%%/etc/${name}.conf
pidfile="/var/run/${name}.pid"

stop_postcmd=stop_postcmd

stop_postcmd()
{
  rm -f $pidfile
}

load_rc_config "$name"

case "$postfwd_enable" in
    [Yy][Ee][Ss] | 1 | [Oo][Nn] | [Tt][Rr][Uu][Ee]) ;;
    *) echo "To make use of $name you must first set $rcvar=\"YES\" in /etc/rc.conf" ;;
esac

: ${postfwd_enable="NO"}
: ${postfwd_config="%%PREFIX%%/etc/${name}.conf"}

command_args="--shortlog --summary=600 --cache=600 --cache-rbl-timeout=3600 --cleanup-requests=1200 --cleanup-rbls=1800 --cleanup-rates=1200 -d -f ${required_files} -i 127.0.0.1 -p 10040 -u nobody -g nobody"

run_rc_command "$1"