Need help with Categorizer sink and IMailTransportCategorize
I've seen many other people requesting help on this topic, but I didn't
see many replies, so I'll post my own.
I'm trying to implement an Exchange server categorizer sink. I've
created a DLL based on Microsoft's example
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/smtpevt/html/cdd17bce-be12-44cf-808c-682fe9d4fa3e.asp);
however, this code seems to be out-of-date and incomplete. There were
several tracing functions that were not defined (DebugTrace and
ErrorTrace), and the code did not include the IDL. I puzzled this out
and got it to compile, then registered it on the Exchange server I
wanted to test it on and registered it with smtpreg.vbs. (The
registration command, in case it's relevant:
cscript smtpreg.vbs /add 1 OnCategorize SampleCatReader CatReader.Read
"mail from=*"
)
CatReader is the library; Read is the coclass.
In any case, this DLL implements the IMailTransportCategorize interface
and uses the ICategorizerParameters interface. However, it didn't seem
to work. Right now it looks for 2 attributes (officeLocation and
sAMAccountType) in each message, but it also logs all calls to all of
its functions. In particular, there is a function Register that
apparently is supposed to figure out which attributes it should be
tracking. (Right now I'm just trying to track attributes with this
categorizer--I'll move on to more complicated stuff later.) However,
neither Register nor any other function (except DllRegisterServer, of
course) is ever called. So, my questions:
1) Am I using the correct approach? The smtpreg.vbs registration
seemed to work.
2) Who calls IMailTransportCategorize::Register and
IMailTransportCategorize::ProcessItem, and when?
3) Is there any documentation, in any book or website, on these
interfaces? I haven't found any.
4) Several websites make reference to a default, disabled Categorize
event sink in Exchange that can be enabled through the System Manager.
Is this something I need to be concerned about? If so, where can I
find out how to do it?
5) Finally, the Microsoft documentation makes reference to the metabase
key smtpsvc/DSFlags, claiming it needs to be set to 0x1000F or 0x3000F.
I've looked at the IIS 6.0 metabase for this server, and there is no
such flag. (I've also seen some documentation that claims that the
flag is in LM\smtpsvc\<instance number>\Routing Sources. It's not
there either.) Does anyone know what this is? So far as I can tell, I
can't just create that key--each one has a numeric ID, and I don't
think I can just pick an ID out of thin air.
Thanks in advance,
Nathan Sugioka
date: 18 Apr 2006 09:39:09 -0700
author: NPS