Set the following IMAP Flags ...
It replaces any previously set flags.

Setflag is used for setting system flags, it replaces any previously set flags.

Message labels are called flags in the IMAP specification and are divided into two types: system flags and user-defined flags.

System flags are defined in the IMAP Specification. They start with a leading backslash (\). The current the following six system flags \Seen , \Answered, \Flagged, \Deleted, \Draft, \Recent are defined.

User-defined flags are also known as IMAP keywords and, as the name implies, are defined by IMAP users. There is a de facto standard that keywords which are in common use have names that begin with a dollar sign ($).

Examples of common keywords are: $Label1, $Label2, $Label3, $Label4, $Label5. These keywords are typically hardwired to Important, Work, Personal, To Do and Later.

If you define your own personal keyword, its name should not begin with dollar sign ($) or backslash (\) because otherwise it might collide with a flag that is used by current or future IMAP clients and servers