Repository navigation
feat(dovecot): upgrade to Dovecot 2.4 - #335
Merged
Merged
Conversation
stephdl
reviewed
Nov 9, 2026
Build the mail-dovecot image from Alpine 3.24, which ships Dovecot 2.4.5 and the fts-flatcurve plugin, and rewrite the configuration in the 2.4 syntax. The package provides no base configuration anymore, so the template now renders the whole dovecot.conf. Keep the 2.3 behavior where 2.4 changed defaults: \NoSelect mailboxes are listed, mailbox names escaped by listescape are read as before, and FTS uses "da" as default language like 2.3 did. Clear-text authentication is still allowed from localhost and trusted networks only: with "ssl = yes" Dovecot 2.4 treats them as secured connections, so they need no special setting. The storage version stays at 2.3, so the existing data keeps its formats. The dict userdb is gone in 2.4: a Lua userdb reads the custom quota from the existing uquota dict files. Actions and scripts address the quota and spam retention dicts by filter name, as the doveadm dict commands no longer accept dict URIs. Existing mailboxes, indexes, FTS indexes and dict files are used as they are. If the local.conf.d snippets break the configuration, like those written for 2.3, they are all rejected: renamed to hidden .<name>.<timestamp>.err files with a warning, so Dovecot can start. The check runs on each configuration reload and leaves no state behind. The dovecot_custom_config_rejected_count fact counts the rejections. Assisted-by: Claude Code:claude-opus-5-5
Add tests for the Dovecot features whose configuration the module generates: shared seen flags in both modes, user listing, custom quota and spam retention dicts, mailbox name escaping, FTS default language and lookup, and the rejection of invalid local.conf.d snippets. Check also the IMAP privilege of a user who is not a master user. Assisted-by: Claude Code:claude-opus-5-5
Align the postfix, rspamd and clamav images to the Alpine release of the dovecot image. Postfix moves to 3.11, Rspamd to 4.0 with Redis 8.8, ClamAV to 1.4.6. With Rspamd 4.0 URLs found in attachment contents, like PDF files, are checked too. Assisted-by: Claude Code:claude-opus-5-5
Postfix smtpd processes keep their connection to the Dovecot auth process started before a Dovecot reload, and that process still has the previous configuration. After enabling or disabling a mailbox, or changing the master users, SMTP authentication kept the old behavior until the smtpd processes were recycled. Reload Postfix after Dovecot, so the smtpd processes connect to the new auth process. Assisted-by: Claude Code:claude-opus-5-5
rspamc takes an optional argument for -P: a separate argument starting with "-" is not used as the password, and rspamc fails with "Invalid password". The generated Rspamd password can start with "-", so on such installations the Junk folder spam/ham learning never reached Rspamd, and the bypass rules tests failed. Use --password=VALUE, which takes any value. Assisted-by: Claude Code:claude-opus-5-5
Dovecot 2.3 let the last delivered message exceed the quota limit by 10% of the limit. Dovecot 2.4 replaced it with a fixed 10M grace, so small quotas were no longer enforced: a 4.6 MB message was accepted for a 2 MiB mailbox. Dovecot 2.4 does not accept a percentage, so set the grace to 10% of the default limit and of each custom limit. Assisted-by: Claude Code:claude-opus-5-5
Raise dovecot_storage_version from 2.3.21 to 2.4.5. Going back to the previous release is not supported anyway, so there is no reason to keep the data readable by Dovecot 2.3. Up to 2.4.5 the only changed format is the v2 thread index used by the IMAP THREAD command: Dovecot rebuilds it the next time a client threads a mailbox. No other data is converted. Assisted-by: Claude Code:claude-opus-5-5
Robot strips the trailing newline from command output, so the "og\n" check passed even if "og" was the last token. Match whole words at the end of a line instead. Assisted-by: Claude Code:claude-sonnet-5-5
DavidePrincipi
force-pushed
the
dovecot-2.4
branch
from
November 10, 2026 11:12
9af6ac3 to
b7fd387
Compare
The Postfix reload added after the Dovecot reload became the last command of the step, so its exit code hid a failed Dovecot reload and the action reported success. Stop at the first failing command. Assisted-by: Claude Code:claude-opus-5-5
The doveadm dict commands address the custom quota dict by the name of its settings block, quota_clone, not by the dict name uquota, which is rejected as an unknown filter. Assisted-by: Claude Code:claude-opus-5-5
stephdl
approved these changes
Nov 10, 2026
stephdl
left a comment
Contributor
There was a problem hiding this comment.
I tested the latest images on a node: login on IMAP, POP3 and SMTP from trusted and untrusted networks, master users, custom quota and FTS. All good, thanks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Mail application runs Dovecot 2.3, which is no longer developed. This PR moves it to Dovecot 2.4, with an automatic migration of existing installations during the normal update. NethServer/dev#8267
All Mail images now build from Alpine 3.24: Dovecot 2.4.5, Postfix 3.11, Rspamd 4.0 with Redis 8.8, ClamAV 1.4.6. Mailboxes, indexes, full-text search (FTS) indexes, quotas, shared folders and Sieve filters are used as they are. Dovecot writes them in its 2.4.5 formats, which changes only the thread index used by the IMAP THREAD command: it is rebuilt automatically the next time a client needs it. Custom Dovecot settings in
local.conf.dwritten with the old syntax cannot be loaded by Dovecot 2.4: they are disabled with a warning, so the mail server still starts. The release is meant to ship as Mail 2.0: going back to the previous release after the update is not supported.local.conf.dbreak the configuration, all of them are renamed to hidden.<name>.<timestamp>.errfiles. A new fact,dovecot_custom_config_rejected_count, counts these rejections.How to test
local.conf.d.Generated by Claude Code:claude-opus-5-5 with nethserver-pr