DOVEADM-SEARCH(1)
π DOVEADM-SEARCH β the "where my mail at" era π
okay bestie, so this is doveadm-search, and it lives in the Dovecot manual, section 1. It's the glow-up page for the search command, and it's genuinely iconic. Let me walk you through it. π
β¨ NAME β¨
doveadm-search β show a list of mailbox GUIDs and message UIDs matching given search query.
Like, it doesn't give you the mail itself, it gives you the receipts: which mailbox, which message. Slay.
πΈ SYNOPSIS πΈ
doveadm [GLOBAL OPTIONS] [-f formatter] search [-S socket_path] -A
search_query
doveadm [GLOBAL OPTIONS] [-f formatter] search [-S socket_path] -F file
search_query
doveadm [GLOBAL OPTIONS] [-f formatter] search [-S socket_path] --no-
userdb-lookup search_query
doveadm [GLOBAL OPTIONS] [-f formatter] search [-S socket_path] -u user
search_query
four whole forms. it's giving versatility. β¨
π¦ DESCRIPTION π¦
The search command is used to find matching messages. doveadm(1) will print the mailbox's guid and the message's uid for each match.
When you use it with the -A or -u wildcard options, doveadm(1) will print the fields username, mailbox-guid and uid for each matching message.
So, form by form, no cap:
- first form β
doveadm(1)will executed the search action will be performed for all users. - second form β the command will be performed for all users listed in the given file.
- third form β the command will be performed for the user contained in the
USERenvironment variable. - last form β only matching mails of the given user(s) will be searched.
π GLOBAL OPTIONS π
Global doveadm(1) options, bestie. These are the ones that apply everywhere, not just here:
-Dβ enables verbosity and debug messages. it's giving "tell me everything" energy. π£οΈ-Oβ do not read any config file, just use defaults. Thedovecot_storage_versionsetting defaults to the latest version, but can be overridden with-o. raw-dogging the defaults, honestly. π-kβ preserve entire environment fordoveadm, not justimport_environmentsetting.-vβ enables verbosity, including progress counter. progress bar era! π-iinstance-nameβ if you're using multiple Dovecot instances, choose the config file based on this instance name. Seeinstance_namesetting for more information. multi-instance main character energy.-cconfig-fileβ read configuration from the givenconfig-file. By default it first reads config socket, and then falls back to/etc/dovecot/dovecot.conf. You can also point this to config socket of some instance running compatible version.-osetting=valueβ overrides the configuration setting from/etc/dovecot/dovecot.confand from the userdb with the given value. In order to override multiple settings, the-ooption may be specified multiple times. stack 'em, queen. π-fformatterβ specifies the formatter for formatting the output. Supported formatters are:flowβ prints each line withkey=valuepairs.jsonβ prints a JSON array of JSON objects.pagerβ prints eachkey: valuepair 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.
This command uses by default the output formatter flow (without the key= prefix). yes, default is flow, no key= prefix, remember that.
π OPTIONS π
the actual options for this command, bestie:
-Aβ if the-Aoption is present, the command will be performed for all users. Using this option in combination with system users fromuserdb { driver = passwd }is not recommended, because it contains also users with a lower UID than the one configured with thefirst_valid_uidsetting. π
When the SQL userdb module is used, make sure that the userdb_sql_iterate_query setting setting matches your database layout.
When using the LDAP userdb module, make sure that 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.
-Ffileβ execute the command for all the users in thefile. This is similar to the-Aoption, but instead of getting the list of users from the userdb, they are read from the givenfile. The file contains one username per line. π--no-userdb-lookupβ do not perform userdb lookup. Use theUSERenvironment variable to specify the username.-Ssocket_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.
-uuser/maskβ run the command only for the givenuser. It's also possible to use'*'and'?'wildcards (e.g.-u *@example.org). wildcards? obsessed. π
π ARGUMENTS π
search_queryβ show messages matching this search query. Seedoveadm-search-query(7)for details. the whole tea is in that other page, fr fr.
β EXAMPLE β
Search in user bob's dovecot mailboxes all messages which contains the word "todo" in the Subject: header:
doveadm search -u bob mailbox dovecot\* subject todo
3a94c928d66ebe4bda04000015811c6a 8
3a94c928d66ebe4bda04000015811c6a 25
3a94c928d66ebe4bda04000015811c6a 45
The search command is mainly useful when used together with doveadm-fetch(1) command.
For example to save message bodies of all messages from INBOX that have "todo" in subject, use:
doveadm search -u bob mailbox INBOX subject todo
while read guid uid; do
doveadm fetch -u bob body mailbox-guid $guid uid $uid > msg.$uid
done
bestie, notice the \* escape in that first command β that's on purpose, don't come for me, copy it exactly. π
π REPORTING BUGS π
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β©
(they want the doveconf -n output too, so don't be shy, send the whole thing. π«Ά)
π§ SEE ALSO π§
doveadm(1), doveadm-search-query(7)
and that's the whole page, bestie!! this was written up as part of the Dovecot docs, and this particular revision is tagged f979264, dated April 2026. go forth and search your mailboxes, you absolute icon. π
β¨π¦
π¦ where this page comes from
- alpine 3.23: dovecot-doc 2.4.5-r0 Β· MIT AND LGPL-2.1-or-later
- alpine 3.24: dovecot-doc 2.4.5-r0 Β· MIT AND LGPL-2.1-or-later
- arch rolling: dovecot 2.4.5-1 Β· MIT AND LGPL-2.1-only
- fedora 43: dovecot 1:2.4.5-1.fc43 Β· MIT AND LGPL-2.1-only
- fedora 44: dovecot 1:2.4.5-1.fc44 Β· MIT AND LGPL-2.1-only
- nixos 26.05: dovecot 2.4.5
- nixpkgs unstable: dovecot 2.4.5
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms