Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: Mon, 17 Oct 2005 02:51:02 -0700,    group: microsoft.public.exchange2000.development        back       


Event is not fired   
Hi,
   My goal is to make a log file when new mail comes to exchange server. So, 
I have installed Exchange in my machine and I have created a script file 
called Sinkscript.vbs which is located in the following path
(C:\Program Files\Exchange SDK\SDK\Support\CDO\Scripts\Sinkscript.vbs)
The file contains the following code.
--------
<SCRIPT LANGUAGE="VBScript">
cdoRunNextSink=0
Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus )

  Dim fs
  Set fs = Create("Scripting.FileSystemObject")
  Dim file
  Set file = fs.OpenTextFile("D:\script\text.log", 8)
  file.write "----------------new mail---------------"
  file.Write "From: " & Msg.From & vbCrLf
  file.Write "To: " & Msg.To & vbCrLf
  file.Write "Subject: " & Msg.Subject & vbCrLf & vbCrLf
  file.Write Msg.TextBody & vbCrLf & vbCrLf
  file.write "----------------End--------------------"
  file.Close
  EventStatus = cdoRunNextSink
End Sub
</SCRIPT>
-----------------------
I have created a log file D:\script\text.log and I have registered the sink 
as follows.

Cscript smtpreg.vbs /add     1 onarrival SMTPScriptingHost 
CDO.SS_SMTPOnArrivalSink "mail from=*"
cscript smtpreg.vbs /setprop 1 onarrival SMTPScriptingHost Sink ScriptName 
"C:\Program Files\Exchange SDK\SDK\Support\CDO\Scripts\Sinkscript.vbs"

I have created two mail ids in my exchange server. Then I stopped and 
started the SMTP server. I am sending and receiving mails locally for each 
IDs, it is working. But my log file is not getting updated.

I need a urgent help in this regard.

Thank you

Aambal
date: Mon, 17 Oct 2005 02:51:02 -0700   author:   Aambal

Re: Event is not fired   
SMTP sinks don't fire on Internal mail traffic (mail between two users on 
the same server) you need to send something where mail is going to be 
processed by the SMTP server (External Outbound or Inbound mail). Eg use 
Outlook Express locally to send a message to any of the mailboxes on your 
server via SMTP

Cheers
Glen

"Aambal"  wrote in message 
news:517DB4F4-1202-4329-B81E-B12BAF29D6E1@microsoft.com...
> Hi,
>   My goal is to make a log file when new mail comes to exchange server. 
> So,
> I have installed Exchange in my machine and I have created a script file
> called Sinkscript.vbs which is located in the following path
> (C:\Program Files\Exchange SDK\SDK\Support\CDO\Scripts\Sinkscript.vbs)
> The file contains the following code.
> --------
> <SCRIPT LANGUAGE="VBScript">
> cdoRunNextSink=0
> Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus )
>
>  Dim fs
>  Set fs = Create("Scripting.FileSystemObject")
>  Dim file
>  Set file = fs.OpenTextFile("D:\script\text.log", 8)
>  file.write "----------------new mail---------------"
>  file.Write "From: " & Msg.From & vbCrLf
>  file.Write "To: " & Msg.To & vbCrLf
>  file.Write "Subject: " & Msg.Subject & vbCrLf & vbCrLf
>  file.Write Msg.TextBody & vbCrLf & vbCrLf
>  file.write "----------------End--------------------"
>  file.Close
>  EventStatus = cdoRunNextSink
> End Sub
> </SCRIPT>
> -----------------------
> I have created a log file D:\script\text.log and I have registered the 
> sink
> as follows.
>
> Cscript smtpreg.vbs /add     1 onarrival SMTPScriptingHost
> CDO.SS_SMTPOnArrivalSink "mail from=*"
> cscript smtpreg.vbs /setprop 1 onarrival SMTPScriptingHost Sink ScriptName
> "C:\Program Files\Exchange SDK\SDK\Support\CDO\Scripts\Sinkscript.vbs"
>
> I have created two mail ids in my exchange server. Then I stopped and
> started the SMTP server. I am sending and receiving mails locally for each
> IDs, it is working. But my log file is not getting updated.
>
> I need a urgent help in this regard.
>
> Thank you
>
> Aambal
date: Tue, 18 Oct 2005 12:33:41 +1000   author:   Glen Scales [MVP]

Re: Event is not fired   
Thank you very much Glen . my code is getting fired now.
Aambal
"Glen Scales [MVP]" wrote:

> SMTP sinks don't fire on Internal mail traffic (mail between two users on 
> the same server) you need to send something where mail is going to be 
> processed by the SMTP server (External Outbound or Inbound mail). Eg use 
> Outlook Express locally to send a message to any of the mailboxes on your 
> server via SMTP
> 
> Cheers
> Glen
> 
> "Aambal"  wrote in message 
> news:517DB4F4-1202-4329-B81E-B12BAF29D6E1@microsoft.com...
> > Hi,
> >   My goal is to make a log file when new mail comes to exchange server. 
> > So,
> > I have installed Exchange in my machine and I have created a script file
> > called Sinkscript.vbs which is located in the following path
> > (C:\Program Files\Exchange SDK\SDK\Support\CDO\Scripts\Sinkscript.vbs)
> > The file contains the following code.
> > --------
> > <SCRIPT LANGUAGE="VBScript">
> > cdoRunNextSink=0
> > Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus )
> >
> >  Dim fs
> >  Set fs = Create("Scripting.FileSystemObject")
> >  Dim file
> >  Set file = fs.OpenTextFile("D:\script\text.log", 8)
> >  file.write "----------------new mail---------------"
> >  file.Write "From: " & Msg.From & vbCrLf
> >  file.Write "To: " & Msg.To & vbCrLf
> >  file.Write "Subject: " & Msg.Subject & vbCrLf & vbCrLf
> >  file.Write Msg.TextBody & vbCrLf & vbCrLf
> >  file.write "----------------End--------------------"
> >  file.Close
> >  EventStatus = cdoRunNextSink
> > End Sub
> > </SCRIPT>
> > -----------------------
> > I have created a log file D:\script\text.log and I have registered the 
> > sink
> > as follows.
> >
> > Cscript smtpreg.vbs /add     1 onarrival SMTPScriptingHost
> > CDO.SS_SMTPOnArrivalSink "mail from=*"
> > cscript smtpreg.vbs /setprop 1 onarrival SMTPScriptingHost Sink ScriptName
> > "C:\Program Files\Exchange SDK\SDK\Support\CDO\Scripts\Sinkscript.vbs"
> >
> > I have created two mail ids in my exchange server. Then I stopped and
> > started the SMTP server. I am sending and receiving mails locally for each
> > IDs, it is working. But my log file is not getting updated.
> >
> > I need a urgent help in this regard.
> >
> > Thank you
> >
> > Aambal 
> 
> 
>
date: Tue, 18 Oct 2005 04:26:02 -0700   author:   Aambal

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us