+1 vote
by (160 points)

For Imap Office 365 connections its not possible to set the Keyword list according to this code:

imap.SetMessageFlags(info.UniqueId, ImapFlagAction.Add, ImapMessageFlags.Keywords, "TestFlag");

Does there exist a workaround?

Applies to: Rebex Secure Mail

1 Answer

0 votes
by (73.6k points)

It seems that the Office 365 does not support custom Imap Keywords.

This is outlook.office365.com response for Inbox:

OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags

And this is response of a mail server which supports custom Imap Keywords:

OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft test01 \*)] Flags permitted.

Note the \* sequence in the second case. If present, the server supports custom Imap Keywords as defined in RFC 3501:

The PERMANENTFLAGS list can also include the special flag \*, which
indicates that it is possible to create new keywords by attempting to
store those flags in the mailbox.

Since the Office 365 does not include the \* flag in the response it suggests that it does not support custom Imap Keywords. There is no workaround for this case. We are sorry.

...