DOVEADM-DIRECTOR(1)

๐Ÿ“ฆ
version 2.3.21 ยท 4 versions
, in debian bookworm, ubuntu noble

๐ŸŽ€ NAME ๐ŸŽ€

doveadm-director โ€” manage Dovecot directors. that's the whole job description bestie, and she does it flawlessly ๐Ÿ’… (it's a Dovecot manual page, section 1, iykyk)


โœจ SYNOPSIS โœจ

doveadm [-Dv] [-f formatter] director command [OPTIONS] [ARGUMENTS]

๐Ÿ’– DESCRIPTION ๐Ÿ’–

ok so doveadm director is your girl for both managing and querying the status of the list of backend mail servers where the Dovecot proxy can redirect connections to. two jobs. both iconic. she ate ๐Ÿซถ


๐ŸŒˆ OPTIONS ๐ŸŒˆ

๐Ÿ’… Global doveadm(1) options ๐Ÿ’…

  • -D โ€” enables verbosity and debug messages. she's chatty, we love that.
  • -f formatter โ€” specifies the formatter for formatting the output. the supported formatters are literally these four:
    • flow โ€” prints each line with key=value pairs.
    • pager โ€” prints each key: value pair on its own line and separates records with a form feed character (^L).
    • tab โ€” prints a table header followed by tab separated value lines.
    • table โ€” prints a table header followed by adjusted value lines.
  • -o setting=value โ€” overrides the configuration setting from /etc/dovecot/dovecot.conf and from the userdb with the given value. and listen, in order to override multiple settings, the -o option may be specified multiple times. no cap.
  • -v โ€” enables verbosity, including the progress counter. โญ

๐ŸŽ€ Command specific options ๐ŸŽ€

  • -a director_socket_path โ€” this option is used to specify an alternative socket. the option's argument is either an absolute path to a local UNIX domain socket, or a hostname and port (hostname:port), in order to connect a remote host via a TCP socket. by default doveadm(1) will use the socket /run/dovecot/director-admin. the socket may be located in another directory when the default base_dir setting was overridden in /etc/dovecot/dovecot.conf. so like, check your config before you spiral ๐Ÿ’€

๐ŸŒธ ARGUMENTS ๐ŸŒธ

  • host โ€” a mail server's hostname or IP address.
  • ip โ€” a director's IP address.
  • port โ€” the TCP port on which the director server is listening for connections. the default port is the same as what the local director is listening in.
  • user โ€” a user's login name. depending on the configuration, a login name may be for example jane or john@example.com.
  • vhost_count โ€” the number of "virtual hosts" to assign to this server. the higher the number is relative to other servers, the more connections it gets. the default is 100. โš–๏ธ

๐Ÿ‘‘ COMMANDS ๐Ÿ‘‘

director add

doveadm director add [-a director_socket_path] host [vhost_count]

the command's tasks are:

  • assign a new mail server to the director.
  • increase/decrease the vhost_count of an already assigned server.

director dump

doveadm director dump [-a director_socket_path]

dump the current host configuration as doveadm commands. these commands can be easily run after a full director cluster restart to get back to the dumped state. it's giving โœจrestoration arcโœจ

director flush

doveadm director flush [-a director_socket_path] [-F] [--max-parallel n]
host|all

doveadm director flush removes all user associations either from the given host or all hosts. all the existing connections will be kicked. if director_flush_socket is specified, a flush script is also automatically executed.

because the kicking and moving of users to new backends creates a temporary load spike, all the users aren't moved at once. the --max-parallel parameter specifies how many users can be moved concurrently. the default is 100.

if the -F parameter is used, the user associations are simply dropped. existing connections won't be kicked and flush scripts aren't run.

lowkey important: -F is the "no drama, just drop it" mode. nobody gets kicked, no scripts run. ๐Ÿ“

director kick

doveadm director kick [-a director_socket_path] user

kick the specified user from the entire Dovecot cluster. this is similar to doveadm proxy kick, but this command needs to be run only once instead of in each director server. one and done, main character energy ๐Ÿ‘‘

director map

doveadm director map [-a director_socket_path] [-f users_file] [-h|-u]
[host]

the command doveadm director map is used to list current user โ†’ host mappings.

โš ๏ธ note that the director works using 32bit hashes which makes collisions quite likely, so this command can't reliably list exactly which users have recently logged in. don't treat it like gospel, bestie. ๐Ÿ™ˆ
  • -f users_file โ€” path to a file containing all user names (one per line). when given, no userdb lookup will be performed. this may be a helpful alternative when for example the network connection to the LDAP or SQL server is slow.
  • -h โ€” output all usernames which match the given hash.
  • -u โ€” output hash for the given username.
  • host โ€” specify a server's IP address or hostname, to list only mappings of the given host.

director move

doveadm director move [-a director_socket_path] user host

move the user to the specified backend host. if the user has any existing connections they will be killed. ๐Ÿ’€ sorry girl

director remove

doveadm director remove [-a director_socket_path] host

use this command in order to remove the given host from the director.

director ring add

doveadm director ring add [-a director_socket_path] ip [port]

add a new director to the ring. ๐Ÿ’โœจ

director ring remove

doveadm director ring remove [-a director_socket_path] ip [port]

remove a director from the ring.

director ring status

doveadm director ring status [-a director_socket_path]

show the status of all the directors currently in the ring.

director status

doveadm director status [-a director_socket_path] [user]

this command is used to show the current usage of all assigned mail servers.

when a user name is given, this command shows which server the user is currently assigned to, where the user will be assigned after the current saved assignment gets removed, and where the user would be assigned to if the whole proxy cluster was restarted fresh. three futures, one command, we stan ๐Ÿ”ฎ


๐Ÿ—‚๏ธ FILES ๐Ÿ—‚๏ธ

  • /etc/dovecot/dovecot.conf โ€” Dovecot's main configuration file.
  • /etc/dovecot/conf.d/10-director.conf โ€” Director specific settings.

๐ŸŒŸ EXAMPLE ๐ŸŒŸ

add a director with vhost count 150 (or change an existing one's vhost count to 150):

doveadm -v director add x1357.imap.ha.example.net 150
2001:db8:543:6861:143::1357: OK

remove a director:

doveadm director remove x1357.imap.ha.example.net

query the status of mail hosts in a director:

doveadm director status
mail server ip       vhosts  users
192.168.10.1            100    125
192.168.10.2            100    144
192.168.10.3            100    115

query the status of a user's assignment:

doveadm director status user@example.com
Current: 192.168.10.1 (expires 2010-06-18 20:17:04)
Hashed: 192.168.10.2
Initial config: 192.168.10.3

so what does all that mean? this means that the user is currently assigned to the mail server on IP 192.168.10.1. after all of the user's connections have logged out, the assignment will be removed (currently it looks like at 20:17:04, but that may be increased). after the assignment has expired, the user will next time be redirected to 192.168.10.2 (assuming no changes to director settings). and if the entire Dovecot proxy cluster was restarted, so that all of the director configuration would revert back to its initial values, the user would be redirected to 192.168.10.3. the whole timeline is right there, obsessed ๐Ÿ’–


๐Ÿ› REPORTING BUGS ๐Ÿ›

report bugs, including doveconf -n output, to the Dovecot Mailing List <dovecot@dovecot.org>. information about reporting bugs is available at: http://dovecot.org/bugreport.html

fr fr, include the doveconf -n output. they want it, periodt.

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€


and that's the whole page bestie ๐Ÿซถ this one's from Dovecot v2.3, dated 2014-08-30. go forth and manage those directors, you absolute icon ๐Ÿงš๐Ÿ’œ

๐Ÿ“ฆ where this page comes from