About MAPI URLs for Notification-Based Indexing
|About MAPI URLs for Notification-Based Indexing|
When a store provider notifies an indexer that an object is ready for indexing, it generates a MAPI Uniform Resource Locator (URL) that uniquely identifies the object to the MAPI Protocol Handler. MAPI URLs are encoded in Unicode, and have the following format:
The various parts of the typical URL are described below.
- Current user’s security identifier.
- A string that specifies the display name of the user on that store.
- A DWORD in hexadecimal representation that is calculated based on the store entry ID or the store mapping signature. This value is stored in the registry and will be used later to identify the store in the MAPI Protocol Handler. This number must be calculated in a way that minimizes collisions with other stores. For the algorithm that Microsoft Office Outlook uses to calculate the hash number, see Algorithm to Calculate the Store Hash Number.
- A number that identifies the type of the store that contains the object to be indexed. The possible values are:
- 0 – Default store.
- 1 – Delegate store, used for delegate items cached locally.
- 2 – Public folders, used for public folder favorites.
- The path from the root of the IPM_SUBTREE to the folder or message. For example, a message in the Family folder under Inbox has Inbox/Family for this parameter.
- MAPI entry ID for the item encoded as a Unicode string. See the section "Special Characters" for information on how certain special characters get encoded. For more information about the algorithm to encode the entry ID, see Algorithm to Encode Entry IDs and Attachment IDs. Note that when viewed as text, this encoded entry ID appears as random Hangul characters or boxes, depending on available fonts.
- Attachment ID encoded as a Unicode string. See the section "Special Characters" for information about how certain special characters get encoded. For more information about the algorithm to encode the entry ID, see Algorithm to Encode Entry IDs and Attachment IDs. Note that when viewed as text, this encoded attachment ID appears as random Hangul characters or boxes, depending on available fonts.
- Name of the attachment file, as it appears in the message.
Examples of MAPI URLs
The following are some examples of MAPI URLs.
- MAPI URL for a folder:
mapi://S-1-5-21-2127521184-1604012920-1887927527-71418/Mailbox – Some User ($be19928f)/2/Office
- MAPI URL for a message:
mapi://S-1-5-21-2127521184-1604012920-1887927527-71418/Mailbox – Some User ($484efb89)/0/Calendar/곯가가가걍걝걌곌겷걢곒갑겛개가검걟곔걙곾걤곂갠가
- MAPI URL for an attachment:
mapi://S-1-5-21-2127521184-1604012920-1887927527-71418/Mailbox – Some User ($484efb89)/0/Inbox/곯가가가걍걝걌곌겷걢곒갑겛개가검걟곔걙곾간곷갦가/at=겅걋각가:somefile.txt
Certain characters are encoded if they are appear in the message or attachment. The following shows which characters are encoded in a MAPI URL:
- % -> %25
- / -> %2F
- \ -> %5C
- * -> %2A
- ? -> %3F
Blob Associated With Each MAPI URL
When pushing a MAPI URL for an object to be indexed, a store provider also creates a blob that contains certain information for the MAPI Protocol Handler. The store provider associates this blob with each MAPI URL and sends it when pushing the MAPI URL to the indexer. The format of the blob is the following:
- This is the version of the data being sent. Currently this value is 1.
- Reserved for future use. Currently this value should be 0.
- The size of the profile name in bytes. This information is useful for the MAPI Protocol Handler to know which profile to use when indexing the item.
- Null-terminated Unicode string that contains the profile name.
- Size of the provider item ID in bytes. The store provider should send the provider item ID only for folders, to prevent opening extra folders to get this information.
- Null-terminated Unicode string with the provider item ID that uniquely identifies the item in the store.