-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
This version is not semver in that the upgrade from 2.3.x to 2.4.x is a breaking change (Migration guide).
Build-time failure
Presently building DMS image there is support to opt-in to the community repo which will install Dovecot with 2.4.x release:
docker build --build-arg DOVECOT_COMMUNITY_REPO=1 --tag localhost/dms .- Build fails compiling FTS Xapian plugin
1.9.0(due to Dovecot2.4.0changes). This is an easy fix resolved upstream with the1.9.1release (compatible with earlier Dovecot versions).
Run-time failure (with current Dovecot 2.3.x config)
Anything that runs doveconf or triggers Dovecot to parse the config will trigger the following failures. This is not a complete list of migration changes required.
docker run --rm -itd --hostname beta.example.test --name dms-beta localhost/dms-
Auth:
setup email add [email protected] secretto provision the initial account createspostfix-accounts.cf(thus DMS continues setup), but Dovecot logs an error due to/etc/dovecot/conf.d/auth-passwdfile.inc:doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/auth-passwdfile.inc line 10: passdb { } is missing section nameCurrent file content as of DMS v15.0.2:
passdb { driver = passwd-file mechanisms = plain login args = scheme=SHA512-CRYPT username_format=%u /etc/dovecot/userdb } userdb { driver = passwd-file args = username_format=%u /etc/dovecot/userdb default_fields = uid=docker gid=docker home=/var/mail/%d/%u/home/ }Seems to require
passdb passwd-file {, despite thedriverfield being set which is documented as being used when the section name is missing. This is part of the config syntax changes.UPDATE: The migration guide covers this concern specifically, if the
driveris not specified it can instead be any other value as a name/scope. EDIT:userdbneeds this too.After resolving that, more errors are output regarding our
passwd-filePassDB driver config, then the UserDB equivalent.-
PassDB:
argsis no longer valid for this PassDB driver, it has separate fields.%uvariable is dropped (as is any other single letter variable). This value should now be%{user}, providing the value[email protected], whereas the similar%nfilters to only the local-part would now be:%{user | username}.- The 1st arg (
scheme) for the default password scheme is now thedefault_password_schemefield. - The 2nd arg (
username_format) is now theauth_username_formatfield. - The final arg (the passwd file path) is now the
passwd_file_pathfield.
mechanismswas renamed tomechanisms_filter.
Thus we get the following:
passdb passwd-file { driver = passwd-file mechanisms_filter = plain login default_password_scheme = SHA512-CRYPT auth_username_format = %{user} passwd_file_path = /etc/dovecot/userdb } -
UserDB:
Now the associated UserDB in that file also needs to apply similar changes.
default_fieldswas changed tofields, with separate subfields and different syntax:userdb passwd-file { driver = passwd-file auth_username_format = %{user} passwd_file_path = /etc/dovecot/userdb # Defaults field values for an entry if they're missing in `/etc/dovecot/userdb`. # NOTE: That file is created from `postfix-accounts.cf` + `postfix-virtual.cf` fields { uid:default = docker gid:default = docker # NOTE: The `%{user}` segment should technically be `%{user | username}`: home:default = /var/mail/%{user | domain}/%{user}/home/ } }NOTE: Since DMS creates
/etc/dovecot/userdb, thehomefield shouldn't be empty, hence no bug reports about the usage of%u, but it seems like that would have inserted the full email address. I think we also have a default global fallback configured here (viamail_location/mail_home) where the expected%nis actually used. -
/etc/dovecot/conf.d/10-auth.confis the next failure:doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-auth.conf line 10: disable_plaintext_auth: Unknown setting: disable_plaintext_authThe
disable_plaintext_authsetting has been renamed toauth_allow_cleartext, this is inverted.That setting has a related DMS script to update to reflect the changes:
docker-mailserver/target/scripts/helpers/ssl.sh
Lines 354 to 359 in 23bb1c8
# no => insecure auth allowed, yes (default) => plaintext auth only allowed over a secure connection (insecure connection acceptable for non-plaintext auth) local DISABLE_PLAINTEXT_AUTH='no' # no => disabled, yes => optional (secure connections not required), required (default) => mandatory (only secure connections allowed) local DOVECOT_SSL_ENABLED='no' sed -i -r "s|^#?(disable_plaintext_auth =).*|\1 ${DISABLE_PLAINTEXT_AUTH}|" /etc/dovecot/conf.d/10-auth.conf sed -i -r "s|^(ssl =).*|\1 ${DOVECOT_SSL_ENABLED}|" "${DOVECOT_CONFIG_SSL}" NOTE: Only applied when
SSL_TYPEis not set which is unlikely to affect most users.
-
-
Logging:
doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-logging.conf line 45: verbose_ssl: Unknown setting: verbose_sslverbose_ssl=>log_debug = category=ssl. We have this set asverbose_ssl = no, but nothing in scripts seems to use it, nor any documentation related to it. It was committed 9 years ago as part of the switch to Dovecot from Courier.The next error is about the empty
pluginsection, which was committed at the same time asverbose_ssl. We'd have to go over any interactions with DMS there, but notably in Dovecot 2.4.x thepluginsection itself was removed. -
General mail settings:
/etc/dovecot/conf.d/10-mail.conffails withmail_location = maildir:/var/mail/%d/%n, which was split into multiple settings (Ref: equivalent Dovecot 2.3.x docs with dedicated Mail Location page).Looking at the 2.4.0 Quick-start config example it looks like
mail_driver+mail_pathare all we're using formail_location. -
SSL:
/etc/dovecot/conf.d/10-ssl.conf- Many SSL settings were renamed, one is for server-side cipher preference which we have set toyes, the bool was changed toclient/serverstring values instead, so we'd change this tossl_server_prefer_ciphers = server.NOTE: After the changes are run, once
doveconfis run you'll be able to usedovecot ssl_serverto query these related settings with thessl_serverprefix:$ dovecot ssl_server ssl_server { cert_file = </etc/ssl/certs/ssl-cert-snakeoil.pem dh_file = </etc/dovecot/dh.pem key_file = </etc/ssl/private/ssl-cert-snakeoil.key prefer_ciphers = server }
Being able to customize each individually with the prefix as part of the setting name is a Dovecot 2.4.0 feature known as
Named Filters/Named List Filters.For DMS it's a bit awkward to modify nested settings via
sed, so we typically use an approach to toggle via comments. This new feature makes it easier to override specific settings without requiring multiple lines or more complicatedsedmatching (if the setting name is too generic). -
Plugins:
- Dovecot Quota:
/etc/dovecot/conf.d/90-quota.confhas apluginsection.- Since Dovecot 2.4.0 removed the
pluginsection from config syntax, all it's fields are now meant to be global settings. - Some fields don't seem to exist anymore in the 2.4.0 docs, nor were they mentioned in the
quotadocs page. May need to investigate. The migration page notes various changes to quota settings / renames too. - Reminder: Quota test-suite coverage has been disabled for some time due to CI issues previously encountered (may no longer be an issue).
- Dovecot Sieve:
/etc/dovecot/conf.d/90-sieve.confalso has apluginsection.- Like with
quotaplugin, various changes in settings names and changes. This will need further investigation. sieve_extensionsis configured with+notify +imapflags(deprecated Sieve extensions) which have been removed.
- Dovecot Quota:
This does detail all required changes to migrate
I removed the quota + sieve config files which finally got doveconf to work without any more errors output. This does not mean the above is all that needs to be changed.
For example, these variables (%d / %n) did not raise any error:
$ doveconf mail_home
mail_home = /var/mail/%d/%n/home/I've not gone over the various feature permutations of DMS either, we have LDAP and OAuth features for example. The migration docs have a fair bit noted about the OAuth changes too.
This at least documents the initial set of changes we'll need to resolve for the migration (assuming Dovecot 2.4.x is part of the next Debian 13 Trixie release).
Metadata
Metadata
Assignees
Labels
Type
Projects
Status