Platform SDK: CDO for Windows 2000

Event Source and Sink Binding Properties

Additional configuration information for each binding is stored in the Source and Sink property bags. The set of properties used within the Sink and Source property bags depends on the source and sink implementation. The following sections describe the set of Source and Sink properties used when creating Simple Mail Transfer Protocol (SMTP) and Network News Transfer Protocol (NNTP) transport event sinks with Microsoft® Collaboration Data Objects (CDO).

SMTP and NNTP Event Source Properties

For the SMTP and NNTP event sources, you can set two optional properties for each binding:

Rule
The event dispatcher uses this rule as an SMTP or NNTP protocol condition that must be met for the sink to be notified of the event. For example, an SMTP OnArrival event binding could have the Rule property set to "ehlo=microsoft.com". When a message transfer agent or user agent transmits the SMTP protocol command, EHLO microsoft.com, during message delivery, the event dispatcher compares this command against the event-binding rule. If the transmitted protocol command matches the binding condition, the source then notifies the sink. If the condition does not match, the sink is not notified of the event.
Priority
The event dispatcher uses a single thread to notify bound sinks of a particular transport event in serialized fashion (that is, one by one). The order in which the sinks are notified can be controlled using the Priority property. The value can range from 0 to 32767, with 0 being the highest priority and 32767 the lowest priority. The default priority is 24575. Sinks with the same priority run in an indeterminate order. Sinks with higher priority always run before those with lower priority. If a priority is not specified for the binding, the default value of 24575 is assumed.

Sink Properties

With CDO, the ScriptName property in the Sink property bag is used with the CDO SMTP and NNTP event scripting hosts to specify the path to the file that contains script code for executing an event. For more information, see Implementing Sinks with Scripting Languages.

Example Bindings

The following table displays an example binding of a set of registered event sinks.

SMTP OnArrival Event Source Bindings

ID Display name SinkClass Source property bag
{GUID1} Sink 11 MySinks.MySink1 Priority=150

Rule="mail from=*@microsoft.com"

{GUID2} Sink 12 MySinks.MySink2 Rule="EHLO=*microsoft.com"
{GUID3} Sink 13 MySinks.MySink3 Priority=30000

Rule="rcpt to=somename*;mail from=user1*"


Note that Sink 12 has no priority value set. Sinks with no priority have the default value of 24575. For more information about creating and managing event sink and source bindings, see Managing Event Bindings.

The following table displays an example binding of an event sink written in a scripting language.

SMTP OnArrival Event Binding using a CDO Scripting Host

ID Display Name SinkClass Source Property Bag Sink Property Bag
{GUID4} Script Sink CDO.SS_SMTPOnArrivalSink Priority = 300

Rule = "mail from=*"

ScriptName="c:\scripts\mysmtpscript.vbs"

In this case, the actual event sink is the CDO.SS_SMTPOnArrivalSink event scripting host Component Object Model (COM) class. The scripting host executes the script code in the file specified in the ScriptName property, which is located in the Sink property bag, for the particular event. For more information, see Implementing Sinks with Scripting Languages.