User Defined Flags
Most of servers support user defined flags which are reported in response: OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft NonJunk Junk \*)
Message method setFlag support's only slashed flags, because before any Flag prepend "\". $flag = "\\".trim(is_array($flag) ? implode(" \\", $flag) : $flag); As you see in this code, current version in setFlag('Seen') store flag \Seen therefore setFlag("Junk") ends with error:
There is also possibility to get user defined flags "NonJunk" or "Junk" set on message on server, because response of getFlags() is empty server, event when message response << 3 FETCH (FLAGS (\Flagged NonJunk))
Describe the solution you'd like Allow to work with full set of Flags, common with "\" and also user defined. Maybe to add support to getRawFlags, setRawFlag to not break backward compatibility where getFlags, setFlag, etc. which replace "\" from flag.
Just a side-note as quotes from 2.3.2. Flags Message Attribute chapter of RFC3501 IMAP 4rev1:
A system flag is a flag name that is pre-defined in this specification. All system flags begin with "\".
A keyword is defined by the server implementation. Keywords do not begin with "\". Servers MAY permit the client to define new keywords in the mailbox
Depending on the RFC, it is absolutely normal use case, if non-backslash-prefixed flags (keywords) exist on server.
Yeah, that's correct, but library working only with system flash with "\" as first charater and used in internally without it. And this is case to solve.
Hi @stanolacko , many thanks for your report and suggestion. If you would like to implement and push a variable flag prefix, feel welcome to do so :)
Best regards,
Ok. Thanks to suggestion :D