blob: e887f7d6c170d8290a6b301173fd4b1fcf6533cf (
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
46
47
48
49
50
51
52
53
54
55
56
|
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: smtpd mail
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable smtpd:
# smtpd_enable (bool): Set it to "YES" to enable OpenSMTPD.
# Default is "NO".
# smtpd_config (string): Path to OpenSMTPD configuration file.
# Default is "%%PREFIX%%/etc/mail/smtpd.conf"
# smtpd_flags (string): Additional flags to be passed to smtpd.
# Default is "".
#
#
. /etc/rc.subr
check_process()
{
/bin/pgrep -j none -f 'smtpd: \[priv\]'
}
name="smtpd"
rcvar=smtpd_enable
start_precmd="smtpd_precmd"
restart_precmd="smtpd_checkconfig"
configtest_cmd="smtpd_checkconfig"
extra_commands="configtest"
load_rc_config $name
: ${smtpd_enable:="NO"}
: ${smtpd_config:="%%PREFIX%%/etc/mail/smtpd.conf"}
: ${smtpd_procname:="%%PREFIX%%/sbin/smtpd"}
: ${smtpd_flags:=""}
command=${smtpd_procname}
procname=${smtpd_procname}
smtpd_checkconfig()
{
echo "Performing sanity check on smtpd configuration:"
eval ${command} ${smtpd_flags} -n
}
smtpd_precmd()
{
smtpd_checkconfig
}
run_rc_command "$1"
|