1

I am working on application, which need to be refactored from using Java Mail API (with IMAP) to Exchange Web Services (EWS). I decided to use ews-java-api. To recreate existing business logic, I need to use some kind of equivalent for IMAP flags, precisely: Answered, Recent and Seen.

So far I found discussions, which outcome was to use MAPI properties - at least for answered flag, but there were suggestions to use PR_LAST_VERB_EXECUTED property, which seems not to be enough information for me. Do anyone knows is this possible to get such information from this API library/MAPI at all?

Nevaan
  • 129
  • 2
  • 11

2 Answers2

0

I pulled a list of IMAP flags from this question.

Mostly, it's a matter of working out which MAPI properties store the information you're looking for. A great place to figure this out is by looking at messages in MFCMAPI, paying special attention to PT_LONG properties which have flag values.

I mapped a few for you:

Recent is weird. If you're interested in knowing about messages that have arrived recently, you might want to look at EWS Sync.

sgriffin
  • 337
  • 1
  • 9
0

I have had to deal with this exact same issue and can tell you that there is no definitive way in MAPI to tell if a message has been answered or not. It happens that MAPI does define a message flag that is documented as marking a message that has been answered but it is not used. The best way I know of is to examine the Outlook icon associated with the message, that is property PR_ICON_INDEX. In many instances when a message has been answered this will tell you but, for several reasons, it is not a reliable indicator in all cases. The primary reason is that, if something else was done with the message after it was answered, for example it was forwarded, then the icon will indicate only the latter operation.

  • Exactly, what bothers me is that I feel that this is not the reliable property... I am going to check sgriffin's asnwer, so I can tell if this is better approach – Nevaan Jul 12 '18 at 08:35
  • sgriffin is probably the best possible person to give advice on this. But be careful. The MSGSTATUS_ANSWERED flag that is documented in one of the pages he refers you to would seem to be exactly what you need. However, while you can certainly set that flag when a message is replied to in an IMAP context, it will generally not tell you if a message has been replied to in other contexts. In particular, it is not set when a message is replied to in Outlook. – Hieronymous Jul 16 '18 at 12:52