Do EWS offer a similar system or flag for "Recent" as IMAP ?

0 votes
asked Oct 7, 2016 by pilouk (520 points)

Do EWS offer a similar system or flag for "Recent" as IMAP ?

We cannot go with Unread flag since we need to parse all new email even if they has been readed.We cannot guaranteed that it has been readed by our app.

Applies to: Rebex Secure Mail

1 Answer

+1 vote
answered Oct 10, 2016 by Pavel Matyska (9,640 points)
selected Oct 12, 2016 by pilouk
 
Best answer

Hello,

EWS do not have any similar feature as Recent flag in IMAP. Additionally, I think that this feature is not the best for you as I read your second paragraph. Only first session get Recent flag in IMAP that connects to the mailbox. So, if anybody other than your app connects to the mailbox, he/she gets the Recent flag of new messages and your app do not.

Better approach in my opinion is to use date and time of last check request and get all messages from that time. Then I would remember all item's IDs for future checks, last set of IDs should be enough. Using this you should get all messages.

This is the line to retrieve all messages since last check time:

ews.Search(EwsFolderId.Inbox, EwsSearchParameter.Arrived(lastCheckTime, null));

You can swap DateTime.Now and null parameter if you want.

asked Oct 18, 2016 by pilouk (520 points)
edited Oct 18, 2016 by pilouk
Imap search parameter arrived doesn't filter hours ?
...