Home / Alt manpages / doveadm(1)

  • doveadm(1)
  • User command
  • linux

Reload or Stop Dovecot Safely with doveadm

By the end of this guide you will be able to check the installed doveadm command set, reload Dovecot after a configuration change, and recognise when stopping the server is a service outage rather than a routine administrative action. The examples target the installed Ubuntu package, Dovecot 2.3.21, and take about 10 minutes if you already have shell access.

Before you begin

You need a shell on the Dovecot host, the dovecot-core package, and permission to access Dovecot's administrative socket. Reloading and stopping the master process normally require root privileges, so use sudo where your system grants it. Do not test the stop command on a production server merely to see what it does.

Keep a copy of the configuration change you are about to apply, and know how this host starts Dovecot again. A reload is usually reversible by restoring the previous configuration and reloading it. A stop is service-disrupting and needs an explicit restart procedure.

Checkpoint 1: confirm the local command

Check the package version and ask doveadm for its command list. This avoids copying options from a different Dovecot release. The installed package reports version 2.3.21 on this machine.

dpkg-query -W dovecot-core; doveadm help

The first command should print a dovecot-core version beginning with 1:2.3.21 here. The second prints global syntax followed by commands such as reload and stop. If it reports a permission error while connecting to a Dovecot socket, rerun the administrative command with sudo, rather than changing socket permissions.

Checkpoint 2: validate before reloading

Inspect the effective configuration before asking the running server to read it. The main doveadm manpage identifies /etc/dovecot/dovecot.conf, conf.d/10-mail.conf, and conf.d/90-plugin.conf as key configuration files. On a host with local packaging or include conventions, follow the files actually referenced by dovecot.conf.

sudo doveconf -n

Read the output for the setting you changed and for obvious path, permission, or syntax mistakes. Save the output if you need to report a failure. The Dovecot documentation recommends including doveconf -n when reporting a problem.

Checkpoint 3: reload the running server

After the configuration check succeeds, reload Dovecot:

sudo doveadm reload; printf 'reload exit status: %s\n' "$?"

reload tells the Dovecot master to reread its configuration. It does not mean that every existing connection instantly adopts every new setting. Check the command's exit status, then inspect the Dovecot log or service status using the logging and service tools configured on this host.

Exit status 0 means the selected command completed successfully; a value greater than zero means it failed. If reload fails, do not keep editing blindly. Restore the last known-good file, run sudo doveconf -n again, and repeat the reload. A syntax failure should leave the previous running configuration in place, but runtime-only errors still need checking in the logs.

Useful output controls

The global -D option enables debug messages and -v enables verbosity, including a progress counter. The -f option selects a formatter for commands that produce records. For example, table produces aligned columns and flow produces key=value pairs:

sudo doveadm -f table who; sudo doveadm -f flow who

Do not parse human-oriented table output in a script when a stable machine-readable form is available for the specific command. The global -o setting=value option overrides a configuration setting for that invocation, and can be repeated. Treat that as a controlled diagnostic tool: an override does not update the configuration files.

Stopping Dovecot

Warning

doveadm stop stops Dovecot and all its child processes. Existing mail clients will disconnect, and new connections will fail until the service is started again. Use it only for planned maintenance or a documented recovery procedure.

sudo doveadm stop; printf 'stop exit status: %s\n' "$?"

Before running it, record the service manager command or platform procedure that starts Dovecot on this host. The doveadm manpage does not prescribe one universal start command. After maintenance, start it using that procedure and verify both the service state and a real client connection. If the stop command fails, check the Dovecot log and process state before repeating it; repeated attempts can obscure the original fault.

Common traps

  • Using an option from another release: run doveadm help on the target host first. This guide is written against Dovecot 2.3.21.
  • Confusing reload with restart: reload asks the master to reread configuration. It is not a full process replacement and is not a substitute for a planned package upgrade.
  • Ignoring privilege boundaries: a shell that can execute doveadm may still be unable to reach the administrative socket. Preserve the socket's ownership and use the intended administrative account.
  • Assuming a successful exit proves application health: the command result covers that invocation. Check logs, process state, and a representative mail client afterwards.

Done means

  • doveadm help shows the commands available on this host.
  • sudo doveconf -n validates the effective configuration you intended to use.
  • sudo doveadm reload returns exit status 0, and the logs show the expected reload.
  • If you stopped Dovecot, you have started it using the host's documented procedure and verified a real connection.