blob: 1187e79eb67a4f5862537050e8cadcda19a6d63b (
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
|
#!/bin/sh
# PROVIDE: mailhog
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# mailhog_enable (bool): Set to NO by default.
# Set it to YES to enable mailhog.
# mailhog_bind_addr (ipaddr): Set to the address mailhog should listen on
# for incoming connections. 127.0.0.1 by default.
# mailhog_smtp_port (int): Port to listen on for SMTP. 1025 by default.
# mailhog_api_port (int): Port to listen on for API. 8025 by default.
# mailhog_ui_port (int): Port to listen on for UI. 8025 (same as API)
# by default.
# mailhog_runtimeuser (string): User mailhog should run as. 'nobody' by default.
#
# Please think twice before exposing this server to the Internet. This is an
# insecure tool without any authentication specifically to aid development
# and debugging. Use in controlled environments only is highly recommended.
#
. /etc/rc.subr
name="mailhog"
rcvar="mailhog_enable"
pidfile="/var/run/${name}.pid"
: ${mailhog_enable:="NO"}
: ${mailhog_bind_addr:="127.0.0.1"}
: ${mailhog_smtp_port:="1025"}
: ${mailhog_api_port:="8025"}
: ${mailhog_ui_port:="8025"}
: ${mailhog_runtimeuser:="nobody"}
load_rc_config "${name}"
command="/usr/sbin/daemon"
command_args="-c -r -f -P ${pidfile} -u ${mailhog_runtimeuser} %%PREFIX%%/bin/${name} -api-bind-addr ${mailhog_bind_addr}:${mailhog_api_port} -ui-bind-addr ${mailhog_bind_addr}:${mailhog_ui_port} -smtp-bind-addr ${mailhog_bind_addr}:${mailhog_smtp_port}"
run_rc_command "$1"
|