Are you a world traveler? ZoneTick is a cool utility that'll help you stay in touch over multiple time zones!
 
ProxyGen.dll - an EDK Sample  
Nik Okuntseff  MS Exchange Server Programming 

ProxyGen.dll - an EDK Sample

Exchange Development Kit provides sample proxy generation DLL with source code called PROXYGEN. You might want to take a look at it. To compile the DLL - open its MAKEFILE in Developer Studion and let it convert it. Then you should be able to build the DLL.

If you are experimenting with gateway development it would be a good idea to play with this sample DLL. For example, if you can build the DLL, can you install it on the site to provide automatic custom address generation? If you are able to do that, you will understand the process better.

Let us assume that we wanted to use ProxyGen.dll as it is, without changing any code yet. This would be, perhaps, a good first step in development of your own proxy generator. The following list summarizes things to do:

  • Build the DLL. Make a notice of its version. You need to take a look in the file named PROXYVER.RC for PRODUCTVERSION string. It turns out to be 4.0.993.0. You will need to use this version number later when installing the Addr-Type object. Note that right-clicking on the ProxyGen.dll file to examine properties - version of the file yields 4.0, which is would not work (using version 4.0 did not work for me).
  • Create a directory EDK/i386 in the Address share of the Exchange server computer. I am assuming here that you are using an Intel based system. Copy the ProxyGen.dll file in it.
  • Install an Addr-Type object in the Exchange server directory. These objects appear in the site's Configuration/Addressing/E-mail Address Generators container. Normally you would have a few objects already installed there. The point is to add you own, that will associate the address type with ProxyGen.dll. You can install the Addr-Type object with the HrInstallAddressType function, as in the following fragment:

    #include <afxwin.h>
    #include <MAPIVAL.H>
    #include <exchinst.h>

    int main()
    {
      HRESULT hr = HrInstallAddressType("MIG",
        "/o=WRConsulting/ou=WhiteRock",
        "My custom address type for i386",
        "EDK",
        0x00040000,
        0x03E10000,
        "proxygen.dll",
        "i386");
      return hr;
    }

    Notice that I use 4.0.993.0 in hex for DLL version in this code.

  • Edit properties of the "Site Addressing" object that you could find in the site's Configuration container. You need to add another value to its "Gateway-Proxy" attribute. It is easy to do when using Exchange Administrator in raw mode. For example, I have added the following string there:

    EDK:@EDK_WRConsulting

  • Finally, start the bulk process of generating your EDK addresses (proxies) for all Exchange server recipients. You need to do it programmatically by calling the SAD_ScBulkCreateProxy function. The following fragment illustrates that:

    #include <SADAPI.H>

    int main()
    {
      HRESULT hr = SAD_ScBulkCreateProxy("MIG", "EDK", BPTAdd);
      return hr;
    }

The ProxyGen.dll reports errors to the system event log. If things do not go well this would be the best place to look into. For example, I had been able to resolve my version incompatibility problem when by mistake I first used 4.0 instead of 4.0.993.0.

If everything goes well you should be able to see a new EDK address for each recipient in the Exchange site (by examining its e-mail addresses). Also, any new recipient that you will add afterwards will automatically have an EDK proxy address created with help of ProxyGen.dll.

Notice that if you change the third parameter in SAD_ScBulkCreateProxy function from BPTAdd to BPTRemove and call the function again, then all recipients should be cleared of their EDK e-mail address.
 

[ Contents | Home ]

Send comments and suggestions to niko@wrconsulting.com
Copyright © 1997-1998 by Nik Okuntseff