Should I use GUID or DefaultExtendedPropertySet.PublicStrings while constructing ExtendedPropertyDefinition?

十年热恋 提交于 2019-12-01 04:23:50

Immediate answers to my own questions are as below. But after reading I realized there are many more related things to know. So those things follows the answer.

Q1.

  • Yes, DefaultExtendedPropertySet is for grouping purpose. Microsoft pre-defined some namespaces to encourage logical grouping of named properties and included them in this enumeration.
  • Grouping is in place for convinience and also to avoid collisions between names of different properties introduced by different vendors.
  • No there is no API to fetch values of all properties belonging to same group.

Q2.

  • GUID creates a new group thus providing separation at both levels, at group level and name level, However, DefaultExtendedPropertySet.PublicStrings with non-generic name is also sufficient. Point is to avoid collision with named property created by some other vendor. PublicStrings can also provide better discoverability if the application is to be integrated with some other applications (GUIDs might need to be very carefully specified during itegration).

MAPI Properties

  • Microsoft uses the Messaging API (MAPI) as a means to connect different messaging transport components. The MAPI specification represents most objects as properties identified by property identifiers or PropIDs.
  • Property identifiers are a set of hexadecimal values that range from 1 to 0xFFFF (total 65536).
  • Historically, for convinience, these properties are divided into logical groups.
  • Standard MAPI properties or fixed properties - Properties below 0x8000. This range is sub-divided into:
    • Transmittable - This range is made up of properties that Exchange can send with a message.
    • Internal - This range is made up of properties that may be set only by Exchange.
    • Non transmittable - This range represents properties that are not delivered outside the organization when Exchange delivers a message
  • Named Properties - properties above 0x8000. They allow vendors/developers to extend the standard MAPI property set by adding their own properties. There are two flavors of named properties:
    • Properties with numeric names - used by programs such as MS Outlook; these property names are generally defined in a source file.
    • Properties with string names - these properties have GUIDs associated with them along with names, thus allowing developers to divide named properties into property sets.Every GUID represents a property set, thus all named properties with same GUID associated with them belongs to the same property set.

rfc822 x-headers to MAPI properties conversion

  • Messages sent on the Internet are sent in the format message/rfc822 which has support for set of properties called x-headers.
  • Conversion from rfc822 x-headers key-value pair to MAPI properties is done by a component called Imail.
  • Thus if an in-bound message has x-header, Imail will create named property for it and store it on the message.

There are some subtle historical details such as

  • Imail was re-written in Exchange 2000 to include Ad-hoc headers which in turn included x-headers.
  • Since there is a limitation on number (65536) of MAPI-properties, quotas are assigned to them on Exchange server
  • From versions to versions of Exchange server following things are changed due to different design decisions:
    • where MAPI properties will be maintained like on a particular mail or across whole mailbox database
    • rules to reserve GUID and a name to a MAPI property

Read in more details at below links:

Q1) The DefaultExtendedPropertySet enumeration defines the default extended property sets that Exchange has, such as the DefaultExtendedPropertySet.Task. It is not meant to be used for your own custom extended property set.

Q2) MSDN is quite explicit about using a Guid for any custom extended property set, so I would indeed do so. Within that property set, you can of course use any name for your property.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!