4.13.2.3. Configuring acceptable flags

In the IMAP protocol the user can assign flags to mails (or other objects). For example, a flag is assigned to a message to indicate that it has been read (\Seen), it can be marked as important mail or it can be indicated that it has already been answered (\Answered). The usable flags are not predefined in the protocol, IMAP clients can assign any flags they desire.

Flags can be controlled similarly to requests and responses using the flag hash. It is a normative hash indexed by the name of the flag (case sensitive). The common practice is to accept any flags by default and explicitly drop unneeded flags. The possible actions related to flags are shown in the table below.

ActionDescription
IMAP_FLAG_ACCEPT Accept the flag.
IMAP_FLAG_REJECT Reject the flag, including the entire command or response.
IMAP_FLAG_DROP Drop the flag silently, but accept the rest of the command. If the command contains only the flag that is dropped, the entire command is dropped.

Table 4.36.  Action codes for IMAP flags