From b334dce5a2126b06d83520753ddd2cc1cdafc095 Mon Sep 17 00:00:00 2001 From: Timo Nieminen Date: Fri, 12 Jun 2026 07:50:24 +0000 Subject: [PATCH] fix(provisioning): prevent silent save failure around master user With a master user set, saving the provisioning config could fail with no visible feedback when "use master password" was toggled off, or when the separator was left empty (the separator became required-but-empty, so the submit was blocked by native validation only). - Clear master user + separator when master password is disabled, so a value that just became hidden cannot block validation or silently survive. - Default the master user separator to "*" (Dovecot default) when a master user is entered, so the separator field is never required-but-empty. - Give the master password input a unique id per provisioning config (it was a hardcoded duplicate shared with the "add new config" form). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../settings/ProvisioningSettings.vue | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/components/settings/ProvisioningSettings.vue b/src/components/settings/ProvisioningSettings.vue index f445b6ee8b..a32fec39c4 100644 --- a/src/components/settings/ProvisioningSettings.vue +++ b/src/components/settings/ProvisioningSettings.vue @@ -199,12 +199,12 @@
- +

{{ t('mail', 'When only master password is set, all users will authenticate with their normal username and this static password.') }} @@ -513,6 +513,27 @@ export default { }, }, + watch: { + masterPasswordEnabled(enabled) { + if (!enabled) { + // Master user/separator only apply together with the master + // password. Clear them when it is disabled so a value that is + // now hidden cannot silently block or alter the saved config. + this.masterUser = '' + this.masterUserSeparator = '' + } + }, + + masterUser(user) { + // Default to the Dovecot master-user separator so the separator + // field is never required-but-empty (which made saving fail + // without any visible feedback). + if (user.length > 0 && this.masterUserSeparator === '') { + this.masterUserSeparator = '*' + } + }, + }, + beforeMount() { logger.debug('provisioning setting loaded', { setting: this.setting }) },