Removeflag clears flags previously set by "setflag" or "addflag". Calling removeflag with a flag that wasn't set before is not an error and is ignored.
Add flags to a message. It doesn't replace any previously set flags. This means that multiple occurrences of addflag are treated additively.
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