-
-
Notifications
You must be signed in to change notification settings - Fork 185
Description
Hi,
The RFC 9051 define keywords that should be allowed to be used as flag.
Those keywords differ from system flags as they do not begin with "\".
The RFC 9051 defines the following keywords :
- $Forwarded
- $MDNSent
- $Junk
- $NotJunk
- $Phishing
Currently, it is possible to retrieve those keywords by adding them in the list of available flags in the config,
but it is not possible to set or unset them on a message, because the character "\" is added to flags sent to the methods Message::setFlag() and Message::unsetFlag().
Proposed solution
Change the Message::setFlag() and Message::unsetFlag() methods to not add a "\" if the flag starts with "$".
This solution does not break compatibility.
Additional context
IMAP also handle the creation of custom keywords, but this is a bit more complex since custom keywords are not allowed by all servers, or on all folders.
This is defined in the PERMANENTFLAGS response code in the EXAMINE or SELECT command responses, if the special flag "\*" is present.
* OK [PERMANENTFLAGS (\Deleted \Seen \Answered \Flagged \Draft \*)]
Handling this feature would necessit more changes, as there must be a way to know if custom keywords are allowed on a folder, and a breaking change on the Message::setFlag() and Message::unsetFlag() methods to never add the "\" on flags.