Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exchange web services: why is ItemId not constant?

I write a small application, which should automatically process the emails from a public folder. For each email, we want to save some metadata, in a database.

I wanted to use the ItemID to make the link between this metadata and a specific email, and I have just discovered that this ItemId is not constant. For example, if the email is moved from a public folder to another, it will receive another ItemId. That means, that the link between the email and the associated metadata is lost.

So, the problem is, how can I make the link between the metadata and the specific email?

like image 605
dann Avatar asked Nov 12 '10 11:11

dann


People also ask

Is Exchange ID unique?

View the Exchange identifierUsers can see the unique device identifier called the Exchange Device ID, which is recognised by Exchange. A user can supply this identifier to you so that the device can be approved and allowed access to Exchange services.

How does Exchange Web Services work?

Exchange Web Services (EWS) is a cross-platform API that enables applications to access mailbox items such as email messages, meetings, and contacts from Exchange Online, Exchange Online as part of Office 365, or on-premises versions of Exchange starting with Exchange Server 2007.

What is EWS ChangeKey?

Any change to that item creates a new ChangeKey. This allows Exchange to "know" that your update is being applied to the same item state as when you looked at the item - it hasn't changed since you checked it.

What is Exchange object ID?

Every object in the Exchange store has a unique identifier. You can use an object's identifier to reference the object and to distinguish it from other objects. The two most common identifiers that you might work with are folder and item identifiers.


1 Answers

My understanding is, that the EWS unique id contains the EntryId in some form. Therefore, it will change once the element is moved to another folder.

And while not applicable here, the situation is more complicated with calendar entries, as Exchange destroys and recreates an appointment under certain circumstances, thereby changing the unique id.

This page (http://msdn.microsoft.com/en-us/library/cc815908.aspx) contains an overview over MAPI properties which can be used to identify an object. An alternative to this is that you can add your own id property to the Exchange element (via extended property).

like image 167
Henning Krause Avatar answered Oct 21 '22 09:10

Henning Krause