Platform SDK: SMTP Server Events

MailMsg Custom Properties

[This is preliminary documentation and subject to change.]

You can add additional custom properties to MailMsg objects as it passes through the service for use by your application. To avoid the possibility of identifier duplication between other applications, you register a range or ranges of identifier values with each MailMsg object. For each requested range, you pass a globally unique identifier (GUID) and the requested number of unique property identifiers for the range to the IMailMsgPropertyManagement::AllocPropIDRange method on the object. The method then returns an internally generated base DWORD identifier value for the range. For the lifetime of that MailMsg object, this range or property identifiers is reserved for your sinks. The store driver object that provides the backing store for the object's data is required to persist these custom properties.

Properties stored using these identifiers are not used by the transport or any of the supplied default event sinks. Only your event sinks will use these custom GUID-scoped properties.

Use these custom properties to persist application-specific information about the message as it passes through the protocol and transport components. For example, you may choose to mark messages that have already been processed by a previous sink to avoid recursive processing by subsequent sinks, and so forth.