1
1
Fork 0
mirror of https://github.com/docker-mailserver/docker-mailserver synced 2024-05-07 08:56:06 +02:00
docker-mailserver/target/bin/listdovecotmasteruser
Andrew Cornford 2f3cbfc144
feat: Support for Dovecot master accounts (#2535)
Dovecot master accounts can now be configured in DMS via `setup.sh`.
A master account is useful for administration purposes, or to perform mailbox backups of every user account over IMAP.
Upstream Docs: https://doc.dovecot.org/configuration_manual/authentication/master_users/

Co-authored-by: Casper <casperklein@users.noreply.github.com>
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2022-05-08 00:28:32 +02:00

22 lines
615 B
Bash
Executable File

#! /bin/bash
# shellcheck source=../scripts/helpers/index.sh
source /usr/local/bin/helpers/index.sh
# suppress error output, e.g. when listmailuser runs in a fresh container (DMS not running)
# shellcheck source=/dev/null
source /etc/dms-settings 2>/dev/null
DATABASE='/tmp/docker-mailserver/dovecot-masters.cf'
[[ -f ${DATABASE} ]] || _exit_with_error "No 'dovecot-masters.cf' file"
[[ -s ${DATABASE} ]] || _exit_with_error "Empty 'dovecot-masters.cf' - no dovecot master accounts have been added"
while read -r LINE
do
USER=$(echo "${LINE}" | cut -d'|' -f1)
echo "* ${USER}"
done < "${DATABASE}"
exit 0