1#!/bin/sh 2 3# PROVIDE: postfix mail 4# REQUIRE: %%REQUIRE%% 5# KEYWORD: shutdown 6# 7# Add the following lines to /etc/rc.conf to enable postfix: 8# postfix_enable (bool): Set it to "YES" to enable postfix. 9# Default is "NO". 10# postfix_pidfile (path): Set full path to master.pid. 11# Default is "/var/spool/postfix/pid/master.pid". 12# postfix_procname (command): Set command that start master. Used to verify if 13# postfix is running. 14# Default is "%%PREFIX%%/libexec/postfix/master". 15# postfix_flags (str): Flags passed to postfix-script on startup. 16# Default is "". 17# 18 19. /etc/rc.subr 20 21name="postfix" 22rcvar=postfix_enable 23 24: ${postfix_svcj_options:="net_basic"} 25 26load_rc_config $name 27 28: ${postfix_enable:="NO"} 29: ${postfix_pidfile:="/var/spool/postfix/pid/master.pid"} 30: ${postfix_procname:="%%PREFIX%%/libexec/postfix/master"} 31 32start_cmd=${name}_start 33stop_cmd=${name}_stop 34extra_commands="reload" 35reload_cmd="${name}_reload" 36 37pidfile=${postfix_pidfile} 38procname=${postfix_procname} 39 40postfix_start() { 41 %%PREFIX%%/sbin/postfix ${postfix_flags} start 42} 43 44postfix_stop() { 45 %%PREFIX%%/sbin/postfix ${postfix_flags} stop 46} 47 48postfix_reload() { 49 %%PREFIX%%/sbin/postfix ${postfix_flags} reload 50} 51 52run_rc_command "$1" 53