chore: Avoid ENABLE_QUOTAS=1 default when not supported by config

This commit is contained in:
Brennan Kinney 2025-04-23 18:34:06 +12:00 committed by GitHub
parent 54bb7d36ec
commit 5e917d4fbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View file

@ -106,7 +106,6 @@ function __environment_variables_general_setup() {
VARS[ENABLE_POP3]="${ENABLE_POP3:=0}"
VARS[ENABLE_IMAP]="${ENABLE_IMAP:=1}"
VARS[ENABLE_POSTGREY]="${ENABLE_POSTGREY:=0}"
VARS[ENABLE_QUOTAS]="${ENABLE_QUOTAS:=1}"
VARS[ENABLE_RSPAMD]="${ENABLE_RSPAMD:=0}"
VARS[ENABLE_RSPAMD_REDIS]="${ENABLE_RSPAMD_REDIS:=${ENABLE_RSPAMD}}"
VARS[ENABLE_SASLAUTHD]="${ENABLE_SASLAUTHD:=0}"
@ -115,6 +114,15 @@ function __environment_variables_general_setup() {
VARS[ENABLE_SRS]="${ENABLE_SRS:=0}"
VARS[ENABLE_UPDATE_CHECK]="${ENABLE_UPDATE_CHECK:=1}"
# The Dovecot Quotas feature is presently only supported with the default FILE account provisioner,
# Enforce disabling the feature, unless it's been explicitly set via ENV (to avoid mismatch between explicit ENV and sourcing from /etc/dms-settings)
if [[ ${ACCOUNT_PROVISIONER} != 'FILE' ]] || [[ ${SMTP_ONLY} -eq 1 ]] || [[ ${ENABLE_QUOTAS} -neq 1 ]]; then
_log 'debug' "The 'ENABLE_QUOTAS' feature is enabled by default but is not compatible with your config. Disabling"
VARS[ENABLE_QUOTAS]="${ENABLE_QUOTAS:=0}"
else
VARS[ENABLE_QUOTAS]="${ENABLE_QUOTAS:=1}"
fi
_log 'trace' 'Setting IP, DNS and SSL environment variables'
VARS[DEFAULT_RELAY_HOST]="${DEFAULT_RELAY_HOST:=}"