Setting Sink and Source Binding Properties

Setting Sink and Source Binding Properties

Each registered SMTP or NNTP event sink has a set of property bags that represent groups of related properties for the binding. The Source property bag contains the Rule and Priority properties that can be used to set the protocol rule and relative firing priority for the sink defined by the binding. When configuring a binding for a CDO event scripting host, the Sink property bag can be set with the ScriptName property. This property is the path to the script that the host should run when handling the event. The smtpreg.vbs and nntpreg.vbs scripts provide a flag and arguments that add or update properties for the sink bindings as follows:

Syntax

cscript [smtpreg | nntpreg].vbs
                    /setprop
                    instance
                    event
                    display name
                    property bag name
                    property name
                    property value
  • instance
    The number of the NNTP or SMTP virtual server instance; for example, 1.
  • event
    The event for which you are registering the sink. For the SMTP event service, the value must be OnArrival. For the NNTP event service, the values are OnPost, OnPostFinal, and OnPostEarly. These values are case-insensitive. Quotes around the name are optional.
  • display name
    The display name of the sink. When using the scripts, each binding should have a unique display name for each virtual server instance and event. The display names are case-sensitive. Use quotes around the name if it contains spaces.
  • property bag name
    The property bag name to which you can add or modify the property. The name can be either Source or Sink.
  • property name
    The name of the property for which to set a value; for example, if the property bag specified is Source, you can set the Priority or Rule value. If the property bag specified is Sink and you are registering a scripting host sink, you can set the ScriptName property to specify the path to your script. Use quotes around the path.
  • property value
    The value of the property.

Example

cscript smtpreg.vbs /setprop 1 onarrival MySMTPScriptingHostSink Sink ScriptName "c:\path\to\script.vbs"
cscript nntpreg.vbs /setprop 1 onpost    MyNNTPScriptingHostSink Sink ScriptName "c:\path\to\script.vbs"

This shows setting an explicit priority for the binding:

cscript smtpreg.vbs /setprop 1 onarrival MySink Source Priority 344
cscript nntpreg.vbs /setprop 1 onpost    MySink Source Priority 24575