DOVEADM-INDEX(1)

πŸ’– DOVEADM-INDEX πŸ’–

okay bestie, gather round, because we're talking about doveadm-index from the Dovecot manual, and honestly? it's giving ✨housekeeping✨. this is the page that tells you how to make Dovecot index your mailboxes. no cap. let's get into it 🫢


🌸 NAME 🌸

doveadm-index β€” index mailboxes. that's it, that's the vibe. short, sweet, iconic πŸ‘‘


✨ SYNOPSIS ✨

there's four ways to summon this thing, depending on who you're indexing for. all of them start with doveadm [GLOBAL OPTIONS] index:

doveadm [GLOBAL OPTIONS] index [-S socket_path] -A [-q] [-n max_recent]
mailbox

doveadm [GLOBAL OPTIONS] index [-S socket_path] -F file [-q] [-n
max_recent] mailbox

doveadm [GLOBAL OPTIONS] index [-S socket_path] --no-userdb-lookup [-q]
[-n max_recent] mailbox

doveadm [GLOBAL OPTIONS] index [-S socket_path] -u user [-q] [-n
max_recent] mailbox

like, pick your fighter: everyone (-A), a file full of people (-F), no userdb lookup at all (--no-userdb-lookup), or just one special user (-u user) πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so what does it actually do? it takes the unindexed messages in a mailbox and adds them into the index/cache file. and if full text search is turned on, it also adds those unindexed messages to the fts database. slay.

now here's the tea β˜• β€” the caching only adds the fields that were previously added to the mailbox's caching decisions. so if the user's client has never even touched that mailbox, this command won't do anything useful for it. sorry bestie, that's just how it is 😭

you can peek at a specific mailbox's current caching decisions with the doveadm dump command. very demure, very mindful.

and plot twist β€” messages can also be added automatically to the full text search index using:

fts_autoindex = yes

🌈 GLOBAL OPTIONS 🌈

these are the global doveadm(1) options, aka the ones that apply to the whole vibe:

  • -D β€” enables verbosity and debug messages. more words, more info, more chaos πŸ”₯
  • -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.
  • -k β€” preserve the entire environment for doveadm, not just the import_environment setting.
  • -v β€” enables verbosity, including a progress counter. watching that number go up is oddly satisfying ngl πŸ“ˆ
  • -i instance-name β€” if you're running multiple Dovecot instances, this picks 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 because one override is never enough, you can specify -o multiple times πŸŽ€

πŸ’… OPTIONS πŸ’…

okay this is the main character section. buckle up:

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

when the SQL userdb module is used, make sure the userdb_sql_iterate_query setting setting matches your database layout. (yes, "setting setting" β€” that's what it says, no I will not be fixing it πŸ™ˆ)

when using the LDAP userdb module, make sure the userdb_fields setting and userdb_ldap_iterate_fields setting settings match your LDAP schema. otherwise doveadm(1) will be unable to iterate over all users. and that's a whole mess we don't want πŸ’€

  • -F file β€” execute the command for all the users in the file. this is similar to the -A option, except instead of getting the list of users from the userdb, they're read from the given file. the file contains one username per line. simple. clean. iconic ✨
  • -n max_recent β€” an integer value, which specifies the maximum number of \Recent messages in mailboxes. if the mailbox contains more than max_recent messages with the \Recent flag set, the mailbox will not be indexed. this can be useful to avoid unnecessary indexing for large mailboxes that are never opened. lowkey genius 🧠
  • --no-userdb-lookup β€” do not perform userdb lookup. use the USER environment variable to specify the username. DIY energy fr fr
  • -q β€” queues the indexing to be run by the indexer process. without -q, the indexing is done directly by the doveadm(1) process. some drivers can't handle multiple processes updating the indexes simultaneously, so -q should usually be used on production. > πŸ”₯ production bestie: use -q. that's not a suggestion, that's a lifestyle.
  • -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. remote chaos unlocked 🌐

  • -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 queen behavior πŸ’…

πŸŽ€ ARGUMENTS πŸŽ€

  • mailbox β€” the name of the mailbox to index. just the name, bestie, nothing fancy.

⭐ EXAMPLE ⭐

want to index bob's INBOX? say less:

doveadm index -u bob INBOX

and that's it. bob's INBOX is indexed. we love to see it 🫢


😭 REPORTING BUGS 😭

found a bug? first of all, my condolences. report bugs, including doveconf -n output, to the Dovecot Mailing List ⟨dovecot@dovecot.org⟩. information about reporting bugs is available at: ⟨https://dovecot.org/bugreport.html⟩

don't forget the doveconf -n output, they will literally ask for it πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

the whole family, iykyk πŸ’œ


and that's the whole page, bestie!! this absolute icon of a manual page comes to you from Dovecot, revision f979264, dated April 2026. go forth and index responsibly. mwah πŸ’‹βœ¨πŸŒΈ

πŸ“¦ where this page comes from