[SOLVED] After upgrade to Trixie, dovecot fails to start

I ran the diagnostics (ejabberd still disabled), everything is fine except dovecot.

x dovecot.service - Dovecot IMAP/POP3 email server
     Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Sun 2025-08-10 15:08:47 CEST; 26min ago
 Invocation: b03af5cab24942cc83a95006b936d979
       Docs: man:dovecot(1)
             https://doc.dovecot.org/
    Process: 949 ExecStart=/usr/sbin/dovecot -F (code=exited, status=89)
   Main PID: 949 (code=exited, status=89)
   Mem peak: 6.7M
        CPU: 440ms

Aug 10 15:08:42 fbox systemd[1]: Starting dovecot.service - Dovecot IMAP/POP3 email server...
Aug 10 15:08:46 fbox dovecot[949]: doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/05-freedombox-mail.conf line 22: userdb { } is missing section name
Aug 10 15:08:46 fbox systemd[1]: dovecot.service: Main process exited, code=exited, status=89/n/a
Aug 10 15:08:46 fbox systemd[1]: dovecot.service: Failed with result 'exit-code'.
Aug 10 15:08:47 fbox systemd[1]: Failed to start dovecot.service - Dovecot IMAP/POP3 email server.

So I looked at the file:

$ cat /etc/dovecot/conf.d/05-freedombox-mail.conf
# Direct edits to this file will be lost!
# Manage your settings on Plinth <https://localhost/plinth/apps/email_server>

# Users in FreedomBox are not expected to access mail by logging into the
# system. Storing the mail in single location instead of home directories and
# with single UID/GID simplifies security reasoning and backup/restore
# operations.
#
# When FreedomBox has multiple domains a user is expected to get a mailbox that
# is same across the domains. Changing an domain name is not uncommon in
# FreedomBox. So, authenticate and store mails based on username only instead of
# including domain names in storage path.
#
# For authdb and userdb, the passwd driver looks up using NSS. In FreedomBox,
# NSS is configured to lookup LDAP with the help of libnss-ldapd. There is no
# need to configure LDAP lookup separately.
#
# Directories are created under /var/mail as necessary by dovecot. Permissions
# for newly created directories are inherited from parent directory. FreedomBox
# will remove all permissions for 'others' from /var/mail to ensure that mail is
# not read by non-root users.
userdb {
    driver = passwd
    override_fields = home=/var/mail/%Ln uid=mail gid=mail
}

I used the Debian 13 installer to install freedombox in a virtual machine, looked at the configuration files, there are 2 version, 2.3 and 2.4, and none of these have this file, so I suspect there is some issue with old files not removed.

Here is what I see:

$ LC_ALL=C ls -la /etc/dovecot/conf.d/
total 208
drwxr-xr-x 1 root root  1622 Aug 10 14:28 .
drwxr-xr-x 1 root root   190 Aug 10 13:35 ..
-rw-r--r-- 1 root root   350 Nov 27  2021 05-freedombox-auth.conf
-rw-r--r-- 1 root root  1200 Nov 27  2021 05-freedombox-mail.conf
lrwxrwxrwx 1 root root    70 Aug 10 14:26 05-freedombox-passdb.conf -> /usr/share/freedombox/etc/dovecot/conf.d/2.4/05-freedombox-passdb.conf
lrwxrwxrwx 1 root root    70 Aug 10 14:26 05-freedombox-userdb.conf -> /usr/share/freedombox/etc/dovecot/conf.d/2.4/05-freedombox-userdb.conf
-rw-r--r-- 1 root root  4993 Aug 10 13:34 10-auth.conf
-rw-r--r-- 1 root root  3103 Aug 10 13:34 10-logging.conf
-rw-r--r-- 1 root root 17327 Aug 10 13:34 10-mail.conf
-rw-r--r-- 1 root root  3638 Aug 10 13:34 10-master.conf
-rw-r--r-- 1 root root  2410 Jun 18 16:01 10-metrics.conf
-rw-r--r-- 1 root root  2454 Aug 10 13:34 10-ssl.conf
lrwxrwxrwx 1 root root    68 Aug 10 14:26 15-freedombox-auth.conf -> /usr/share/freedombox/etc/dovecot/conf.d/2.4/15-freedombox-auth.conf
lrwxrwxrwx 1 root root    68 Aug 10 14:27 15-freedombox-mail.conf -> /usr/share/freedombox/etc/dovecot/conf.d/2.4/15-freedombox-mail.conf
-rw-r--r-- 1 root root  1624 Aug 10 13:34 15-lda.conf
-rw-r--r-- 1 root root  3111 Dec 22  2020 15-mailboxes.conf
-rw-r--r-- 1 root root  4635 Aug 10 13:36 20-imap.conf
-rw-r--r-- 1 root root  1762 Aug 10 13:36 20-lmtp.conf
-rw-r--r-- 1 root root  2389 Aug 10 13:36 20-managesieve.conf
-rw-r--r-- 1 root root  4420 Aug 10 13:36 20-pop3.conf
-rw-r--r-- 1 root root   787 Jun 18 16:01 30-dict-server.conf
-rw-r--r-- 1 root root   828 Aug 10 13:35 90-acl.conf
lrwxrwxrwx 1 root root    68 Aug 10 14:27 90-freedombox-imap.conf -> /usr/share/freedombox/etc/dovecot/conf.d/2.4/90-freedombox-imap.conf
lrwxrwxrwx 1 root root    68 Aug 10 14:27 90-freedombox-lmtp.conf -> /usr/share/freedombox/etc/dovecot/conf.d/2.4/90-freedombox-lmtp.conf
lrwxrwxrwx 1 root root    73 Aug 10 14:27 90-freedombox-mailboxes.conf -> /usr/share/freedombox/etc/dovecot/conf.d/2.4/90-freedombox-mailboxes.conf
lrwxrwxrwx 1 root root    70 Aug 10 14:28 90-freedombox-master.conf -> /usr/share/freedombox/etc/dovecot/conf.d/2.4/90-freedombox-master.conf
-rw-r--r-- 1 root root   564 Sep  2  2021 90-freedombox-ssl.conf
lrwxrwxrwx 1 root root    67 Aug 10 14:28 90-freedombox-tls.conf -> /usr/share/freedombox/etc/dovecot/conf.d/2.4/90-freedombox-tls.conf
-rw-r--r-- 1 root root   719 Jun 18 16:01 90-fts.conf
-rw-r--r-- 1 root root  2042 Aug 10 13:35 90-quota.conf
-rw-r--r-- 1 root root  1789 Aug 10 13:36 90-sieve-extprograms.conf
-rw-r--r-- 1 root root  4164 Aug 10 13:36 90-sieve.conf
-rw-r--r-- 1 root root   508 Aug 10 14:30 91-freedombox-tls.conf
lrwxrwxrwx 1 root root    69 Aug 10 14:28 95-freedombox-sieve.conf -> /usr/share/freedombox/etc/dovecot/conf.d/2.4/95-freedombox-sieve.conf
-rw-r--r-- 1 root root   499 Dec 22  2020 auth-checkpassword.conf.ext
-rw-r--r-- 1 root root   508 Aug 10 13:35 auth-deny.conf.ext
-rw-r--r-- 1 root root   343 Dec 22  2020 auth-dict.conf.ext
-rw-r--r-- 1 root root  1346 Aug 10 13:36 auth-ldap.conf.ext
-rw-r--r-- 1 root root   457 Aug 10 13:35 auth-master.conf.ext
-rw-r--r-- 1 root root   507 Jun 18 16:01 auth-oauth2.conf.ext
-rw-r--r-- 1 root root   512 Aug 10 13:35 auth-passwdfile.conf.ext
-rw-r--r-- 1 root root  6093 Aug 10 13:35 auth-sql.conf.ext
-rw-r--r-- 1 root root   820 Aug 10 13:35 auth-static.conf.ext
-rw-r--r-- 1 root root  2296 Aug 10 13:35 auth-system.conf.ext
lrwxrwxrwx 1 root root    69 Aug 10 14:28 freedombox-ldap.conf.ext -> /usr/share/freedombox/etc/dovecot/conf.d/2.4/freedombox-ldap.conf.ext

The file that is causing the issue is from 2021. Perhaps most (or all?) files that are older than today (Aug 10) should be removed? I am not sure what to do exactly.

I made a fresh bookworm install and restored postfix/dovecot. After the restore, dovecot is still not working. Perhaps the restore has restored the faulty configuration?

Looks like I am going to do a fresh install again and this time not restore emails. Glad I configured the mail clients on several computers to store all emails.

The changes need to handle dovecot 2.3 → 2.4 migration are still not available in Trixie. Since the Debian Trixie has been released, I believe will be able to push these changes to Trixie. @jvalleroy should we make a release into Trixie?

Support for Dovecot 2.4 is included in freedombox 25.9.3, which should be in Trixie already.

@Avron What is your current FreedomBox package version?

It was 25.9.3. I am doing a reinstall again, this time I will not restore postfix/dovecot, I will reconfigure everything and rely on the cache on my PCs for past emails.

EDIT: I am having difficulties getting back emails on my PC, no sure I can really rely on this.
EDIT2: It worked like this.

After distribution upgrade, I’m getting similar errors.
Tried Re-Run Setup but left with below error

Error running action: email..setup_spam(): CalledProcessError(89, ["sievec", "/etc/dovecot/freedombox-sieve-after/"])
Stderr:
║ doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-director.conf line 40: inet_listener { } is missing section name
Action traceback:
╞   File "/usr/lib/python3/dist-packages/plinth/actions.py", line 398, in _privileged_call
╞     return_values = func(*arguments['args'], **arguments['kwargs'])
╞   File "/usr/lib/python3/dist-packages/plinth/modules/email/privileged/spam.py", line 27, in setup_spam
╞     _compile_sieve()
╞     ~~~~~~~~~~~~~~^^
╞   File "/usr/lib/python3/dist-packages/plinth/modules/email/privileged/spam.py", line 37, in _compile_sieve
╞     subprocess.run(['sievec', sieve_dir], check=True)
╞     ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╞   File "/usr/lib/python3.13/subprocess.py", line 577, in run
╞     raise CalledProcessError(retcode, process.args,
╞                              output=stdout, stderr=stderr)

Dovecot service wont run.

× dovecot.service - Dovecot IMAP/POP3 email server
     Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Wed 2025-08-20 00:46:59 +03; 21min ago
 Invocation: a4210b4d92e546cb92acca440ba50386
       Docs: man:dovecot(1)
             https://doc.dovecot.org/
    Process: 1276 ExecStart=/usr/sbin/dovecot -F (code=exited, status=89)
   Main PID: 1276 (code=exited, status=89)
   Mem peak: 10.2M
        CPU: 163ms

Ağu 20 00:46:56 havnor systemd[1]: Starting dovecot.service - Dovecot IMAP/POP3 email server...
Ağu 20 00:46:59 havnor dovecot[1276]: doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-director.conf line >
Ağu 20 00:46:59 havnor systemd[1]: dovecot.service: Main process exited, code=exited, status=89/n/a
Ağu 20 00:46:59 havnor systemd[1]: dovecot.service: Failed with result 'exit-code'.
Ağu 20 00:46:59 havnor systemd[1]: Failed to start dovecot.service - Dovecot IMAP/POP3 email server.
lines 1-16/16 (END)...skipping...
× dovecot.service - Dovecot IMAP/POP3 email server
     Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Wed 2025-08-20 00:46:59 +03; 21min ago
 Invocation: a4210b4d92e546cb92acca440ba50386
       Docs: man:dovecot(1)
             https://doc.dovecot.org/
    Process: 1276 ExecStart=/usr/sbin/dovecot -F (code=exited, status=89)
   Main PID: 1276 (code=exited, status=89)
   Mem peak: 10.2M
        CPU: 163ms

Ağu 20 00:46:56 havnor systemd[1]: Starting dovecot.service - Dovecot IMAP/POP3 email server...
Ağu 20 00:46:59 havnor dovecot[1276]: doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-director.conf line 40: inet_listener { } is missing section name
Ağu 20 00:46:59 havnor systemd[1]: dovecot.service: Main process exited, code=exited, status=89/n/a
Ağu 20 00:46:59 havnor systemd[1]: dovecot.service: Failed with result 'exit-code'.
Ağu 20 00:46:59 havnor systemd[1]: Failed to start dovecot.service - Dovecot IMAP/POP3 email server.

App notification shows

Postfix/Dovecot Postfix/Dovecot
Error updating app: Command '['sievec', '/etc/dovecot/freedombox-sieve-after/']' returned non-zero exit status 89.

Any assistance appreciated.
Thanks

/etc/dovecot/conf.d/10-director.conf

This does not seem to be a file shipped either by FreedomBox or dovecot package. Is it a custom change? Could you please upgrade it to Dovecot 2.4 configuration syntax along with any other customization files? Then Re-run setup should succeed.

Honestly, no idea how it ended up there… Maybe from times when i was working on creating spam rules (more than a year ago). Anyhow… this makes me feel uneasy (as if the servers been compromised).
I believe i will go with a fresh install and restore backups.
Thanks @Sunil

Please note that backups contain all the files in the directory /etc/dovecot/conf.d/ . So, when you restore from backup that custom configuration file you have created will also be restored and the problem will resurface. If you think your customization to dovecot is not important, move away the file 10-director.conf (and any other customization files) to some other place and re-run setup. This should get you as good as new. Also, note that you will need two fixes from the latest 25.10 release (this should become available in couple of days).

1 Like

Thanks for this.

I had a downloaded backup from FBX prior doing a fresh install.
After the install;

  • Setup Name Services and restored LetsEncrypt Certificates
  • applied your patch,
  • revised my DKIM keys on DNS proivder and
  • copied my mailboxes folder back into var/mail/*user*/mail/mailboxes.

Mail is in order now.

1 Like