@set MiscDir=%SystemDrive%\CDO\Transport Events\Misc

@rem OnArrival
cscript /nologo smtpreg.vbs /add 1 OnArrival JScriptDumpOA CDO.SS_SMTPOnArrivalSink "mail from=*"
cscript /nologo smtpreg.vbs /setprop 1 OnArrival JScriptDumpOA Sink ScriptName "%MiscDir%\JScript\SinkDumpFields.js"

cscript /nologo smtpreg.vbs /add 1 OnArrival JScriptVBInteropOA CDO.SS_SMTPOnArrivalSink "mail from=*"
cscript /nologo smtpreg.vbs /setprop 1 OnArrival JScriptVBInteropOA Sink ScriptName "%MiscDir%\JScript\SinkDumpFieldsVBSInterop.js"

cscript /nologo smtpreg.vbs /add 1 OnArrival VBScriptFirstOA CDO.SS_SMTPOnArrivalSink "mail from=*"
cscript /nologo smtpreg.vbs /setprop 1 OnArrival VBScriptFirstOA Sink ScriptName "%MiscDir%\VBScript\MessageStatus\first.vbs"

cscript /nologo smtpreg.vbs /add 1 OnArrival VBScriptSecondOA CDO.SS_SMTPOnArrivalSink "mail from=*"
cscript /nologo smtpreg.vbs /setprop 1 OnArrival VBScriptSecondOA Sink ScriptName "%MiscDir%\VBScript\MessageStatus\second.vbs"

cscript /nologo smtpreg.vbs /add 1 OnArrival VBScriptDumpOA CDO.SS_SMTPOnArrivalSink "mail from=*"
cscript /nologo smtpreg.vbs /setprop 1 OnArrival VBScriptDumpOA Sink ScriptName "%MiscDir%\VBScript\SinkDumpFields.vbs"

cscript /nologo smtpreg.vbs /add 1 OnArrival VBScriptJSInteropOA CDO.SS_SMTPOnArrivalSink "mail from=*"
cscript /nologo smtpreg.vbs /setprop 1 OnArrival VBScriptJSInteropOA Sink ScriptName "%MiscDir%\VBScript\SinkDumpFieldsJSInterop.vbs"

cscript /nologo smtpreg.vbs /add 1 OnArrival VBScriptGetSetEnvFldsOA CDO.SS_SMTPOnArrivalSink "mail from=*"
cscript /nologo smtpreg.vbs /setprop 1 OnArrival VBScriptGetSetEnvFldsOA Sink ScriptName "%MiscDir%\VBScript\SinkGetSetEnvFlds.vbs"

cscript /nologo smtpreg.vbs /add 1 OnArrival VBScriptSaveToFileOA CDO.SS_SMTPOnArrivalSink "mail from=*"
cscript /nologo smtpreg.vbs /setprop 1 OnArrival VBScriptSaveToFileOA Sink ScriptName "%MiscDir%\VBScript\SinkSaveMsgToFile.vbs"


@rem OnPostEarly
cscript /nologo nntpreg.vbs /add 1 OnPostEarly VBScriptFirstOPE CDO.SS_NNTPOnPostEarlySink "newsgroups=*"
cscript /nologo nntpreg.vbs /setprop 1 OnPostEarly VBScriptFirstOPE Sink ScriptName "%MiscDir%\VBScript\MessageStatus\first.vbs"

cscript /nologo nntpreg.vbs /add 1 OnPostEarly VBScriptSecondOPE CDO.SS_NNTPOnPostEarlySink "newsgroups=*"
cscript /nologo nntpreg.vbs /setprop 1 OnPostEarly VBScriptSecondOPE Sink ScriptName "%MiscDir%\VBScript\MessageStatus\second.vbs"

cscript /nologo nntpreg.vbs /add 1 OnPostEarly VBScriptSaveToFileOPE CDO.SS_NNTPOnPostEarlySink "newsgroups=*"
cscript /nologo nntpreg.vbs /setprop 1 OnPostEarly VBScriptSaveToFileOPE Sink ScriptName "%MiscDir%\VBScript\SinkSaveMsgToFile.vbs"


@rem OnPost
cscript /nologo nntpreg.vbs /add 1 OnPost JScriptDumpOP CDO.SS_NNTPOnPostSink "newsgroups=*"
cscript /nologo nntpreg.vbs /setprop 1 OnPost JScriptDumpOP Sink ScriptName "%MiscDir%\JScript\SinkDumpFieldsOP.js"

cscript /nologo nntpreg.vbs /add 1 OnPost VBScriptFirstOP CDO.SS_NNTPOnPostSink "newsgroups=*"
cscript /nologo nntpreg.vbs /setprop 1 OnPost VBScriptFirstOP Sink ScriptName "%MiscDir%\VBScript\MessageStatus\first.vbs"

cscript /nologo nntpreg.vbs /add 1 OnPost VBScriptSecondOP CDO.SS_NNTPOnPostSink "newsgroups=*"
cscript /nologo nntpreg.vbs /setprop 1 OnPost VBScriptSecondOP Sink ScriptName "%MiscDir%\VBScript\MessageStatus\second.vbs"

cscript /nologo nntpreg.vbs /add 1 OnPost VBScriptDumpOP CDO.SS_NNTPOnPostSink "newsgroups=*"
cscript /nologo nntpreg.vbs /setprop 1 OnPost VBScriptDumpOP Sink ScriptName "%MiscDir%\VBScript\SinkDumpFields.vbs"

cscript /nologo nntpreg.vbs /add 1 OnPost VBScriptGetSetEnvFldsOP CDO.SS_NNTPOnPostSink "newsgroups=*"
cscript /nologo nntpreg.vbs /setprop 1 OnPost VBScriptGetSetEnvFldsOP Sink ScriptName "%MiscDir%\VBScript\SinkGetSetEnvFlds.vbs"

cscript /nologo nntpreg.vbs /add 1 OnPost VBScriptSaveToFileOP CDO.SS_NNTPOnPostSink "newsgroups=*"
cscript /nologo nntpreg.vbs /setprop 1 OnPost VBScriptSaveToFileOP Sink ScriptName "%MiscDir%\VBScript\SinkSaveMsgToFile.vbs"


@rem OnPostFinal
cscript /nologo nntpreg.vbs /add 1 OnPostFinal VBScriptFirstOPF CDO.SS_NNTPOnPostFinalSink "newsgroups=*"
cscript /nologo nntpreg.vbs /setprop 1 OnPostFinal VBScriptFirstOPF Sink ScriptName "%MiscDir%\VBScript\MessageStatus\first.vbs"

cscript /nologo nntpreg.vbs /add 1 OnPostFinal VBScriptSecondOPF CDO.SS_NNTPOnPostFinalSink "newsgroups=*"
cscript /nologo nntpreg.vbs /setprop 1 OnPostFinal VBScriptSecondOPF Sink ScriptName "%MiscDir%\VBScript\MessageStatus\second.vbs"

cscript /nologo nntpreg.vbs /add 1 OnPostFinal VBScriptSaveToFileOPF CDO.SS_NNTPOnPostFinalSink "newsgroups=*"
cscript /nologo nntpreg.vbs /setprop 1 OnPostFinal VBScriptSaveToFileOPF Sink ScriptName "%MiscDir%\VBScript\SinkSaveMsgToFile.vbs"
