RE: Exchange Event Sink for copying mails

  • From: "Deshwal, Chand" <CDD@xxxxxxxxxxxxx>
  • To: "[ExchangeList]" <exchangelist@xxxxxxxxxxxxx>
  • Date: Tue, 26 Apr 2005 14:15:12 +0530

I had posted the same quite sometime back. Just have a look. In your
case, you have to use * instead of specific mailboxes.





Enabling Per Mailbox Journaling for External E-mails

Well, we all know how to enable message journaling per mailbox store in
Exchange 2003. Its good for compliance purposes, where you need to
maintain all e-mails generated on your mail server(s). This also helps
in case of a server crash, where you are not able to restore your server
back to the original state (Should not happen!). But, what if we want to
perform selective journaling? There are plenty of third party tools
available and they come on a cost. 

There is a free way to do the same, provided, you have at least two
servers or maintain a border server for mail delivery and receipt. This
is achieved by using SMTP Archive Sink, using a small VBSCRIPT.

The script is available for download from OulookExchange
written by Glanscales. 


How to use the script

I assume that you have a two-server scenario, a sort of front-end,
back-end one, where one server hosts all the mailboxes. Mailbox server
forwards all the e-mails to border server. We will register an event
sink on the border server for Outgoing mails for selective mailboxes
(Could be all as well).

We will register another event sink on the mailbox server for Incoming
e-mails for selective mailboxes. 


On the border server (For outgoing mails):

                Make a directory, suppose c:\jrnlarchive

<>  the
script and save it at c:\jrnlarchive. I assume, you saved the file as

                Edit the script and replace
Monitormailbox@xxxxxxxxxxxxxx <mailto:Monitormailbox@xxxxxxxxxxxxxx>  by
your monitoring mailbox.

4110-959D-6E4CB233D79D&displaylang=en>  SMTPREG.VBS provided by
Microsoft to register/un-register event sinks. Save this script in the
same directory as above script.

                Open a command prompt and change directory to

                Type cscript smtpreg.vbs /add 1 onarrival smtpjrnlOut
CDO.SS_SMTPOnArrivalSink "Mail From=user1@xxxxxxxxxxxxxx
<mailto:From=user1@xxxxxxxxxxxxxx> ; Mail From=user2@xxxxxxxxxxxxxx
<mailto:From=user2@xxxxxxxxxxxxxx> ; Mail from=userN@xxxxxxxxxxxxxx
<mailto:from=userN@xxxxxxxxxxxxxx> " and press enter.

                Type all on one line

                Note: Where userN stands for N number of mailboxes. If
you want to do journaling for all the mailboxes for outgoing e-mais,
then the command will be cscript smtpreg.vbs /add 1 onarrival smtpjrnl
CDO.SS_SMTPOnArrivalSink "Mail From=*"

                7. Type cscript smtpreg.vbs /setprop 1 onarrival
smtpjrnlOut Sink ScriptName c:\jrnlarchive\smtpjrnl.vbs

Test it by sending mails from the any of the specified mailboxes.


On the Mailbox Server (For incoming mails):

                Repeat steps 1-5.

                Type cscript smtpreg.vbs /add 1 onarrival smtpjrnlIn
CDO.SS_SMTPOnArrivalSink "Rcpt to=user1@xxxxxxxxxxxxxx
<mailto:to=user1@xxxxxxxxxxxxxx> ; Rcpt to=user2@xxxxxxxxxxxxxx". Press

                To journal incoming e-mails for every mailbox, use:
cscript smtpreg.vbs /add 1 onarrival smtpjrnlIn CDO.SS_SMTPOnArrivalSink
"Rcpt to=* <mailto:to=*> "


                3. Type: cscript smtpreg.vbs /setprop 1 onarrival
smtpjrnlIn Sink ScriptName c:\jrnlarchive\smtpjrnl.vbs

Test it by sending mails to the any of the specified mailboxes.



Bad part is when you need to modify the list of mailboxes to be
journaled. This can be done by remove the sink and re-register it with
modified list of mailboxes. I do it by maintaining a small batch file.


-----Original Message-----
From: Fabrice [mailto:emouchet@xxxxxxxxxx]
Sent: Tuesday, April 26, 2005 2:12 PM
To: [ExchangeList]
Subject: [exchangelist] Exchange Event Sink for copying mails


I'm working with an exchange 2003 server (standard) I need :
to make a copy of all mails from Internet (for the internet domaine,
type :, passing through the virtual smtp server.
to make a copy of mails from the society to Internet.

But not the mails beetween the members of the society.

I think, i must create an event sink. on the smtp server. But i don't
know how !
Do you know a site which is talking about a solution or an add-on.

thanks a lot.

List Archives:
Exchange Newsletters:
Exchange FAQ:
Other Internet Software Marketing Sites:
World of Windows Networking: Leading
Network Software Directory:
No.1 ISA Server Resource Site: Windows Security
Resource Site: Network Security Library: Windows 2000/NT Fax Solutions:
You are currently subscribed to this Discussion List as:
cdd@xxxxxxxxxxxxx To unsubscribe visit
Report abuse to listadmin@xxxxxxxxxxxxxx

The contents of this communication are intended/meant only for addressee(s) and 
may contain information that is privileged or otherwise confidential. If you 
are not the intended recipient you are hereby notified that any disclosure, 
copying, distribution or taking any action in reliance on the contents of this 
information is strictly prohibited and may be unlawful. The contents of this 
e-mail shall not be forwarded to any third party, without first obtaining 
written authorization from the originator or Kampsax India. If you have 
received this electronic mail transmission in error, please delete it from your 
system without copying or forwarding it, and notify the sender of the error by 
reply email or by telephone, so that the sender's address records can be 

Kampsax India (P) Ltd.
809, Phase-V
Udyog Vihar
Gurgaon - 122016
Haryana, India
Tel: +91 124 509 25 00
Fax: +91 124 234 82 63

Other related posts: