DOVEADM-FLAGS(1)

NAME
doveadm-flags - add, remove or replace messages' flags

SYNOPSIS
doveadm [-Dv] flags [-S socket_path] command flags search_query
doveadm [-Dv] flags [-S socket_path] command flags search_query -A
doveadm [-Dv] flags [-S socket_path] command flags search_query -F file
doveadm [-Dv] flags [-S socket_path] command flags search_query -u user

DESCRIPTION
This command is used to manipulate flags of messages. @INCLUDE:global-options@

Command specific options: @INCLUDE:option-A@ @INCLUDE:option-F-file@ @INCLUDE:option-S-socket@ @INCLUDE:option-u-user@

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.

search_query
    Manipulate the flags of messages matching the given search query. See doveadm-search-query(7) for details.

COMMANDS

  flags add
doveadm flags add [-u user| -A|-F file] [-S socket_path] flags search_query

This command is used to extend the current set of flags with the given flags.

  flags remove
doveadm flags remove [-u user| -A|-F file] [-S socket_path] flags search_query

In order to remove the given flags from the current set of flags, use this command.

  flags replace
doveadm flags replace [-u user| -A|-F file] [-S socket_path] flags search_query

This command is used to replace ALL current flags with the given flags.

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 -u bob remove NonJunk mailbox dovecot uid 81563
doveadm flags -u bob add '\Flagged $Forwarded' mailbox dovecot uid 81563
@INCLUDE:reporting-bugs@

SEE ALSO
doveadm(1), doveadm-fetch(1), doveadm-search-query(7)