ports/mail/mailhog/files/mailhog.in
Richard Gallamore 79c9128938 MailHog is an email testing tool for developers:
Configure your application to use MailHog for SMTP delivery
View messages in the web UI, or retrieve them with the JSON API
Optionally release messages to real SMTP servers for delivery

WWW: https://github.com/mailhog/MailHog

PR:		221015
Submitted by:	punkt.de Hosting Team (maintainer)
Reviewed by:	matthew (mentor)
Approved by:	matthew (mentor)
Differential Revision:	https://reviews.freebsd.org/D12069
2017-08-20 17:35:18 +00:00

43 lines
1.5 KiB
Bash

#!/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"