DOVEADM-MAILBOX-CRYPTOKEY(1)

🌸 DOVEADM-MAILBOX-CRYPTOKEY πŸ’…

okay bestie, so this is a page from the Dovecot manual β€” it's the doveadm-mailbox-cryptokey one, aka the mail crypt plugin management era of your life. Let's get into it πŸŽ€


✨ NAME ✨

doveadm-mailbox-cryptokey β€” mail crypt plugin management, no cap. it's giving key management main character energy πŸ”‘


πŸ¦‹ SYNOPSIS πŸ¦‹

doveadm [-o crypt_user_key_password=password] [GLOBAL OPTIONS] mailbox
cryptokey export|generate|list|password [options] [arguments]

πŸ’– DESCRIPTION πŸ’–

Generate a new keypair for a user or for a folder. The new keypair gets marked as active, periodt. ✨


πŸ‘‘ OPTIONS πŸ‘‘

doveadm mailbox cryptokey can be used to manage your user's cryptographic keys. that's the whole vibe fr fr.


🌈 GLOBAL OPTIONS 🌈

these are the global doveadm(1) options, the ones that apply everywhere πŸ’«

  • -D β€” turns on verbosity and debug messages. yapping mode: enabled πŸ—£οΈ
  • -O β€” don't read any config file at all, just use the defaults. the dovecot_storage_version setting defaults to the latest version, but you can override it with -o.
  • -k β€” preserve the entire environment for doveadm, not just the import_environment setting. keep the whole vibe, not a fragment 🫢
  • -v β€” enables verbosity, including a progress counter. progress bar girlies rise πŸ™ˆ
  • -i instance-name β€” if you're running multiple Dovecot instances, pick the config file based on this instance name. see the instance_name setting for more info.
  • -c config-file β€” read configuration from the given config-file. by default it first reads the config socket, and then falls back to /etc/dovecot/dovecot.conf. you can also point this at the config socket of some instance running a compatible version.
  • -o setting=value β€” overrides the configuration setting from /etc/dovecot/dovecot.conf and from the userdb with the given value. and to override multiple settings, just stack the -o option as many times as you want πŸ’…
  • -f formatter β€” specifies the formatter for formatting the output. the supported formatters are:
    • flow β€” prints each line with key=value pairs.
    • json β€” prints a JSON array of JSON objects.
    • pager β€” prints each key: value pair on its own line and separates records with 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 crypt_user_key_password=password β€” Dovecot option, needed if you use password protected keys πŸ”

πŸ’œ OPTIONS πŸ’œ

(same heading name, different energy β€” these are the ones for this command specifically)

  • -A β€” if the -A option is present, the command will be performed for all users. using this option in combination with system users from userdb { driver = passwd } is not recommended, because it contains also users with a lower UID than the one configured with the first_valid_uid setting. 😭

When the SQL userdb module is used, make sure that the userdb_sql_iterate_query setting matches your database layout.

When using the LDAP userdb module, make sure that the userdb_fields setting and the userdb_ldap_iterate_fields setting match your LDAP schema. otherwise doveadm(1) will be unable to iterate over all users. no cap, it just won't.

  • -F file β€” execute the command for all the users in the file. this is similar to the -A option, but instead of getting the list of users from the userdb, they're read from the given file. the file contains one username per line. πŸ“„
  • --no-userdb-lookup β€” do not perform a userdb lookup. use the USER environment variable to specify the username.
  • -S socket_path β€” 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.

This allows an administrator to execute doveadm(1) mail commands through the given socket. 🧚

  • -u user/mask β€” run the command only for the given user. it's also possible to use '*' and '?' wildcards (e.g. -u *@example.org). wildcard slay ⭐

πŸŽ€ SUBCOMMANDS πŸŽ€

export [-U] | mailbox-mask

  • -U β€” operate on user keypair only

Exports user's or folder's keypair(s) in PEM format. if the keys are password protected, -o is needed. πŸ”₯

generate [-Rf [-U] | mailbox-mask]

  • -U β€” operate on user keypair only
  • -R β€” re-encrypt all folder keys with current active user key
  • -f β€” force keypair creation; normally a keypair is only created if none is found

Generates a new keypair for user or folder. if you want to generate a new user key and use it to secure your folder keys, use generate -u username -UR. 🫢

If you want to password-protect your key here, use -o.

list [-U] | mailbox-mask

  • -U β€” operate on user keypair only

List all keys for user or folder. no password is required. easy peasy πŸ’…

password [-N | -n password] [-O|-o password] [-C]

  • -O β€” ask for old password
  • -o old-password β€” provide old password
  • -N β€” ask for new password
  • -n new-password β€” provide new password
  • -C β€” clear (unset/remove) the password. your key will not be protected by a password.

Set, change or clear the password from your user key. glow-up for your credentials ✨


🌟 SEE ALSO 🌟

doveadm(1), doveadm-mailbox(1) β€” go read those too, bestie πŸ“š


and that's the whole page!! this one's from Dovecot, version tag f979264, dated April 2026 β€” so yeah, it's fresh πŸ’– thanks for reading my little manpage rewrite, ily, go manage those crypt keys responsibly πŸ‘‘πŸŒΈ

πŸ“¦ where this page comes from