views:

444

answers:

2

Does anyone know the format of the MAPI property PR_SEARCH_KEY?

The online documentation has this to say about it:

The search key is formed by concatenating the address type (in uppercase characters), the colon character ':', the e-mail address in canonical form, and the terminating null character.

And the exchange document MS-OXOABK says this:

The PidTagSearchKey property of type PtypBinary is a binary value formed by concatenating the ASCII string "EX: " followed by the DN for the object converted to all upper case, followed by a zero byte value.

However all the MAPI messages I've seen with this property have it as some sort of binary 16 byte sequence that looks like a GUID. Does anyone else have any more information about it? Is it always 16 bytes?

Thanks!

+1  A: 

The sentence before the ones you quoted from the online docs reads, "MAPI uses specific rules for constructing search keys for message recipients" which makes me think that it's talking about the PR_SEARCH_KEY property on MAPI_MAILUSER objects -- or at least not on MAPI_MESSAGE objects.

Moishe
+2  A: 

I believe that the property PR_SEARCH_KEY will be of different formats for different objects (as alluded to by Moishe).

A MAPI message object will have a unique value assigned on creation for PR_SEARCH_KEY, however if the object is copied this property value is copied also. I presume when you reply to an e-mail, Exchange will assign the PR_SEARCH_KEY value to be the original message's value.

You will need to inspect each object type to understand how the PR_SEARCH_KEY is formed but I doubt if it's always 16 bytes for all MAPI types.

This link USENET discussion has a good discussion with Dmitry Streblechenko involved who is an expert on Extended MAPI.

Henk