DOVEADM-FLAGS(1)
π DOVEADM-FLAGS(1) π
okay bestie, sit down, hydrate, because we're about to talk about the Dovecot manual page for doveadm-flags. this is the one that adds, removes and replaces your messages' flags. it's giving very much "tiny command, big power" energy and i'm obsessed π
β¨ NAME β¨
doveadm-flags β add, remove or replace messages' flags π
β¨ SYNOPSIS β¨
doveadm [GLOBAL OPTIONS] flags [-S socket_path] -A command flags
search_query
doveadm [GLOBAL OPTIONS] flags [-S socket_path] -F file command flags
search_query
doveadm [GLOBAL OPTIONS] flags [-S socket_path] --no-userdb-lookup
command flags search_query
doveadm [GLOBAL OPTIONS] flags [-S socket_path] -u user command flags
search_query
like, pick your user-selection vibe: -A, -F file, --no-userdb-lookup or -u user. all four are right there, take your pick π«Ά
β¨ DESCRIPTION β¨
this command is used to manipulate flags of messages. that's it, that's the whole thing. manipulate. flags. of. messages. β¨
β¨ GLOBAL OPTIONS β¨
the global doveadm(1) options, bestie β these are the ones that show up everywhere, not just here:
-Dβ enables verbosity and debug messages. she's loud and she's proud π¬-Oβ do not read any config file, just use defaults. thedovecot_storage_versionsetting defaults to the latest version, but can be overridden with-o. (yes, that's-Ouppercase and-olowercase, they are different girls π)-kβ preserve entire environment fordoveadm, not just theimport_environmentsetting.-vβ enables verbosity, including progress counter. progress bar moment π-iinstance-name β if using multiple Dovecot instances, choose the config file based on this instance name. see theinstance_namesetting for more information.-cconfig-file β read configuration from the given config-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 like bracelets π
β¨ OPTIONS β¨
-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. no cap, she'll just be stuck π
-Ffile β execute the command for all the users in the file. this is similar to the-Aoption, but instead of getting the list of users from the userdb, they are read from the given file. the file contains one username per line. one per line bestie, don't get creative βοΈ--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 given user. it's also possible to use'*'and'?'wildcards (e.g.-u *@example.org). wildcard slay π
β¨ ARGUMENTS β¨
- flags β message flags as described in RFC 3501, section 2.3.2 (Flags Message Attribute):
\Answered,\Deleted,\Draft,\Flagged,\Recentand\Seen. and the IMAP keywords$Forwarded,$MDNSent,$SubmitPendingand$Submittedor user-defined keywords, e.g.Junk,$NonSpamor$Label1.
one or multiple flags and/or keywords can be specified. go off, specify several π
- search_query β manipulate the flags of messages matching the given search query. see
doveadm-search-query(7)for details. π
β¨ COMMANDS β¨
πΈ flags add πΈ
doveadm [GLOBAL OPTIONS] flags add [-u user | -A | -F file | --no-
userdb-lookup] [-S socket_path] flags search_query
this command is used to extend the current set of flags with the given flags. it's giving "yes and" energy β the old ones stay, the new ones join the party π
πΈ flags remove πΈ
doveadm [GLOBAL OPTIONS] flags remove [-u user | -A | -F file | --no-
userdb-lookup] [-S socket_path] flags search_query
in order to remove the given flags from the current set of flags, use this command. bye bye flag, you will not be missed π
πΈ flags replace πΈ
doveadm [GLOBAL OPTIONS] flags replace [-u user | -A | -F file | --no-
userdb-lookup] [-S socket_path] flags search_query
this command is used to replace ALL current flags with the given flags. like, ALL of them. everything else is gone. full reset, main character energy π
β¨ EXAMPLE β¨
list and manipulate the message flags of the message with uid 81563:
doveadm fetch -u bob 'uid flags' mailbox dovecot uid 81563
uid: 81563
flags: \Answered \Seen NonJunk
doveadm flags remove -u bob NonJunk mailbox dovecot uid 81563
doveadm flags add -u bob '\Flagged $Forwarded' mailbox dovecot uid 81563
see how NonJunk got yeeted and \Flagged $Forwarded got added? that's the whole plot bestie π₯
β¨ 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β© π
please include that doveconf -n output, bestie, they literally asked π₯Ί
β¨ SEE ALSO β¨
and that's the page!! this lovely thing came from Dovecot source version f979264, dated April 2026, and the manual name up top is of course DOVEADM-FLAGS(1). mwah, go set some flags πβ¨ππ¦
π¦ 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