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. the dovecot_storage_version setting defaults to the latest version, but can be overridden with -o. (yes, that's -O uppercase and -o lowercase, they are different girls 😭)
  • -k β€” preserve entire environment for doveadm, not just the import_environment setting.
  • -v β€” enables verbosity, including progress counter. progress bar moment πŸ“ˆ
  • -i instance-name β€” if using multiple Dovecot instances, choose the config file based on this instance name. see the instance_name setting for more information.
  • -c config-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. πŸ‘‘
  • -o setting=value β€” overrides the configuration setting from /etc/dovecot/dovecot.conf and from the userdb with the given value. in order to override multiple settings, the -o option may be specified multiple times. stack 'em like bracelets πŸ’…

✨ 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 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 😭

  • -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 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 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 🌟

✨ ARGUMENTS ✨

  • flags β€” message flags as described in RFC 3501, section 2.3.2 (Flags Message Attribute): \Answered, \Deleted, \Draft, \Flagged, \Recent and \Seen. and the IMAP keywords $Forwarded, $MDNSent, $SubmitPending and $Submitted or user-defined keywords, e.g. Junk, $NonSpam or $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 ✨

doveadm(1)


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