#!/sbin/openrc-run
supervisor=supervise-daemon

name="mox"
description="modern full-featured open source secure mail server for low-maintenance self-hosted email"

command=/usr/bin/mox
command_args="-config $mox_config_file serve"
command_user="mox:mox"

logdir="/var/log"
output_log="$logdir/${SVCNAME}.log"
error_log="$logdir/${SVCNAME}.log"
pidfile="/var/run/${SVCNAME}.pid"

depend() {
	need net
	after firewall
}

start_pre() {
	checkpath -o "$command_user" -m 644 -f "$output_log"
	checkpath -o "$command_user" -m 644 -f "$error_log"
}
