DOVEADM-REBUILD(1)

πŸ’– DOVEADM-REBUILD(1) β€” bestie edition πŸ’–

okay so this is doveadm-rebuild, from the Dovecot manual, and she's here to rebuild stuff. Sit down, grab a boba, we're doing this. πŸ§‹


✨ NAME ✨

doveadm-rebuild β€” commands related to rebuilding various aspects of mails matching a given search query. rebuild era πŸ’…


🌸 SYNOPSIS 🌸

doveadm [GLOBAL OPTIONS] [-f formatter] rebuild <command> [-S
socket_path] -A search_query

doveadm [GLOBAL OPTIONS] [-f formatter] rebuild <command> [-S
socket_path] -F file search_query

doveadm [GLOBAL OPTIONS] [-f formatter] rebuild <command> [-S
socket_path] --no-userdb-lookup search_query

doveadm [GLOBAL OPTIONS] [-f formatter] rebuild <command> [-S
socket_path] -u user search_query

πŸ¦‹ DESCRIPTION πŸ¦‹

rebuild attachments is the command, and what it does is rebuild attachment presence. That's the whole vibe. And doveadm(1) will print the message's uid for every single match. πŸ’–

When you use it with the -A or -u wildcard options, doveadm(1) prints the fields username and uid for each matching message instead. Not me getting extra fields... 😭

Okay so the four forms, bestie, in order:

  1. In the first form, doveadm(1) will execute the rebuild action for all users. everybody. the whole group chat. πŸ‘‘
  2. In the second form, the command is performed for all users listed in the given file. πŸ“„
  3. In the third form, it's performed for the user contained in the USER environment variable. 🌱
  4. In the last form, only matching mails of the given user(s) will be rebuilt. 🎯

⭐ GLOBAL OPTIONS ⭐

These are the global doveadm(1) options, and yes, you need them:

  • -D β€” enables verbosity and debug messages. the receipts πŸ‘€
  • -O β€” do not read any config file, just use defaults. The dovecot_storage_version setting defaults to the latest version, but you can override it with -o. no config, no problems? (it's giving chaos but okay πŸ’€)
  • -k β€” preserve the entire environment for doveadm, not just the import_environment setting. main character energy, keep your whole vibe.
  • -v β€” enables verbosity, including a progress counter. we love a progress bar 🫢
  • -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 to 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. To override multiple settings, you can specify the -o option multiple times. stack 'em. ✨
  • -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 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.

This command uses by default the output formatter flow (without the key= prefix). no cap. 🌈


πŸŽ€ OPTIONS πŸŽ€

  • -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. 😭
  • -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 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 to 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. πŸ’«

πŸ’œ ARGUMENTS πŸ’œ

  • search_query β€” resets the attachment indicator for messages matching this search query. See doveadm-search-query(7) for the details. πŸ”

🌟 EXAMPLE 🌟

Rebuild user bob's attachment status:

doveadm rebuild attachments -u bob ALL

1
2
3

look at those uids go πŸŽ€


🫢 REPORTING BUGS 🫢

Found a bug? Bestie, report it β€” including your doveconf -n output β€” to the Dovecot Mailing List ⟨dovecot@dovecot.org⟩. Info about reporting bugs lives at: ⟨https://dovecot.org/bugreport.html⟩ πŸ›


πŸ”₯ SEE ALSO πŸ”₯

doveadm(1)


and that's the whole page, bestie β€” go rebuild something iconic. ✨

signing off: this was f979264, from April 2026, and it's the DOVEADM-REBUILD(1) girlies' era. πŸ’…πŸ‘‘

πŸ“¦ where this page comes from