#!/bin/bash
#
# Univention Dovecot
#
# SPDX-FileCopyrightText: 2015-2025 Univention GmbH
# SPDX-License-Identifier: AGPL-3.0-only

. /usr/lib/univention-server/lib/server_password_change/debug.sh
. /usr/share/univention-lib/base.sh

case "$1" in
prechange)
	# nothing to do before the password is changed
	exit 0
	;;
nochange)
	# nothing to do after a failed password change
	exit 0
	;;
postchange)
	# change config and make Dovecot reload after password was changed
	echowithtimestamp "reloading dovecot after server password change"
	univention-config-registry commit /etc/dovecot/dovecot-ldap.conf.ext
	deb-systemd-invoke reload dovecot
	;;
esac
