I am writing an application which reacts to emails sent to a mailbox. It retrieves the emails via IMAP. It will be deployed to a number of systems where I do not control the mail server configuration.
I would like to use IMAP flags to indicate which messages have been handled. Are the system flags sufficiently widely supported that I can reasonably depend on them in my application? Are user-defined flags sufficiently widely supported?
(If the answer is "ha ha, not a chance", then I shall use folders instead.)
Thanks
-Ben
Take a look at this collection of example IMAP server sessions. Essentially whenever you see
PERMANENTFLAGS
contain\*
, the server will support user-defined flags.To add to that list, here is an excerpt from a Gimap (Google Mail IMAP) session:
And similarly, a session from Exchange 2007:
I was unable to find a session from Exchange 2010.
So it's not universal -- with Exchange being the notable abstainer -- but it sure is more common than not.
The main IMAP protocol document is RFC3501. Section 2.3.2 describes the standard flags every IMAP implementation must work with.
Indeed, RFC3501 describes the universal system flags.
There is not any RFC on the subject of user-defined flags, only proposals.
Exchange 2010 has the same set of PERMANENTFLAGS