0

We have a shared mailbox with multiple operators, collecting and inserting ERP sales orders. An order can be picked by different operators and be duplicated in ERP.

Each e-mail has a unique EntryID, but after reading documentation, I can't understand if it is the same for all users of shared mailbox or if for each user there is it's own EntryID.

If it is the same for all, I could log it in a shared file and check if it's done by EntryID.

Community
  • 1
  • 1
IvanSTV
  • 242
  • 1
  • 10

2 Answers2

1

The EntryID property value should be unique in the profile. And here is what MS states:

A MAPI store provider assigns a unique ID string when an item is created in its store. Therefore, the EntryID property is not set for a Microsoft Outlook item until it is saved or sent. The EntryID changes when an item is moved into another store, for example, from your Inbox to a Microsoft Exchange Server public folder, or from one Personal Folders (.pst) file to another .pst file. Solutions should not depend on the EntryID property to be unique unless items will not be moved.

And here is more information for the long-term EntryID values:

Long-term entry identifiers must be unique across all message stores in the active profile; therefore, when a message or folder is copied from one message store to another, it must be assigned a new entry identifier. When a message store object is moved, the message store provider that implements the move determines whether the original entry identifier will remain valid. Some service providers assign new entry identifiers to moved objects; others do not. If there is a change, the new entry identifier will be included in the information passed to clients when they are notified of the move.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • many thanks. Maybe you know - how to check if if service provider changes or not entry ID? – IvanSTV Aug 10 '22 at 07:35
  • 1
    Try to move the item and check whether a value is changed or not. – Eugene Astafiev Aug 10 '22 at 07:38
  • Thanks, tried, unfortunately it changes. Is there in shared mailbox unique for all to strictly identify e-mail - sender\subject can be the sane? Anything else I can pick to identify? – IvanSTV Aug 10 '22 at 07:42
  • 1
    You can introduce your own ID for items. Also try using the search key (PR_SEARCH_KEY). This property provides a trace for related objects, such as message copies, and facilitates finding unwanted occurrences, such as duplicate recipients. – Eugene Astafiev Aug 10 '22 at 07:51
  • Thank you, it was useful. Am i right, that I can ntroduce own ID for e-mail item and it will be the same for all local users of shared mailbox? How? – IvanSTV Aug 10 '22 at 08:23
  • If you store that ID on items it will be remained the same. – Eugene Astafiev Aug 10 '22 at 08:31
  • [https://stackoverflow.com/questions/28731643/how-to-uniquely-identify-an-outlook-email-as-mailitem-entryid-changes-when-email] – IvanSTV Aug 10 '22 at 09:36
  • 1
    Yes, I've mentioned both ways already. – Eugene Astafiev Aug 10 '22 at 09:37
1

It will be unique, but keep in mind that different entry ids can refer to the same message - it can depend on whether it was retrieved from the folder contents table (short term vs long term entry id), primary vs delegate mailbox, etc. Entry ids cannot be directly compared, you need to use Namespace.CompareEntryIDs.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • thanks. I've never thought that this hole is so deep :) so, I can write entry ID's in list whyle they are picked by operators in log and check comparing every new record with the entryIDs in the log with Namespace.CompareEntryIDs It seems to be easier then PR_SEARCH_KEY – IvanSTV Aug 11 '22 at 08:33
  • Yes, but that also means the look up can be slow if you have a large list and you cannot use a dictionary or a hash set to speed up the lookup. – Dmitry Streblechenko Aug 11 '22 at 15:11