diff --git a/docs/content/config/environment.md b/docs/content/config/environment.md index e209a0cf..1d378e3f 100644 --- a/docs/content/config/environment.md +++ b/docs/content/config/environment.md @@ -247,6 +247,12 @@ Set the mailbox size limit for all users. If set to zero, the size will be unlim See [mailbox quota][docs-accounts-quota]. +!!! info "Compatibility" + + This feature is presently only compatible with `ACCOUNT_PROVISIONER=FILE`. + + When using a different provisioner (or `SMTP_ONLY=1`) this ENV will instead default to `0`. + ##### POSTFIX_MESSAGE_SIZE_LIMIT Set the message size limit for all users. If set to zero, the size will be unlimited (not recommended!). Size is in bytes. diff --git a/target/scripts/startup/variables-stack.sh b/target/scripts/startup/variables-stack.sh index 3d0d1bee..dc7fb450 100644 --- a/target/scripts/startup/variables-stack.sh +++ b/target/scripts/startup/variables-stack.sh @@ -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:=}"