#!/usr/bin/env /lib/runit/invoke-run
#Copyright: 2026 Lorenzo Puliti <plorenzo@disroot.org>
#License: CC0-1.0

exec 2>&1

#NOTE: it logs partially to syslog and has its own log system
sv start default-syslog ||  true

#TODO  check inetd.conf  and exit if dovecot is found
#TODO coredume requires unlimited
#[ "$ALLOW_COREDUMPS" = "1" ] && ulimit -c unlimited

ulimit -n 65535
[ -r /etc/dovecot/dovecot.conf ] || exit 162

exec ${XCHPST:-} ##bin##  -F -c /etc/dovecot/dovecot.conf
