PROXYGEN: Generating a Proxy Address

PROXYGEN: Generating a Proxy Address

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release. PROXYGEN is a dynamic-link library (DLL) that generates a proxy address of the type EDK for the Sample Gateway. PROXYGEN creates the address from a combination of site and recipient attributes as determined by the site level proxy.

The PROXYGEN sample application demonstrates the use of the following functions:

  • RcInitProxies
  • RcGenerateProxy
  • RcValidateProxy
  • FreeProxy

To use PROXYGEN, you must first install the EDK address type by running the Sample Gateway setup program.

When the gateway is first installed, or when you modify an existing proxy address, Microsoft® Exchange Server automatically calls the proxy generation DLL to validate the changes. If the modified address contains invalid characters or other errors, Exchange Server displays an error message and the DLL writes an error message to the Microsoft Windows® server operating systems Application event log. The RcValidateProxy routine in PROXYGEN verifies that a manually entered proxy is valid.

Note  Although the native transport for Exchange 2000 is now SMTP, and all Exchange clients will have SMTP addresses, the Exchange 5.5, or legacy, address format is still used by MAPI clients such Outlook. It is also used in mixed-mode environments where both Exchange 2000 and Exchange 5.5 servers are in use. The following example is still valid, though no longer a common scenario.

For example, suppose an Exchange Server Organization name is entered as My Test Org and an Exchange Server Site name is entered as "My Site." The PROXYGEN DLL would create contacts with the format user1@My Site.My Test Org.com. Because an Internet SMTP name with spaces is illegal, the RcValidateProxy call would find this address invalid. An exception would be thrown, and a failed event would be logged to the system.

Note  The only solution for spaces in the organization or site names is to manually change the values for each contact, or to modify the PROXYGEN code.

The PROXYGEN DLL demonstrates several features for creating and modifying proxy addresses. You can use these features or similar ones in your gateway. For more information, see the PROXYGEN sample code.

The following sections summarize the features of PROXYGEN:

Proxy Address Creation

When the gateway is installed, the setup program installs a site address. You can insert special characters in the site address to tell PROXYGEN how to create individual proxy addresses. This feature appears in the RcGenerateProxy function. The RcGenerateProxy function creates proxy addresses based on the site proxy address string. The format of this string is the following:

EDK: format@domain

Domain is uninterpreted and is written exactly as is. Format is optional. If you specify a format it must contain only valid EDK address characters, plus the following special symbols:

Symbol Description
%s Substitute the surname of the user.
%g Substitute the given name of the user.
%d Substitute the display name of the user.
%m Substitute the mailbox name (alias) of the user.
%% Substitute a single %.
%r Substitute characters within a format string.

In all the substitutions listed in the table, spaces and illegal characters will be removed from the field before the substitution is made. If there is no format field, the site proxy address format is equivalent to the following:

EDK: %m@domain

Use the %r symbol to specify replacing one character with another in subsequent substitutions in the format string. The following format is an example:

%g%r ch1 ch2 %s

This format specifies that all instances of the character ch1 will be replaced by ch2 in all surnames as the proxy addresses are generated. In this case, the %r symbol follows the %g symbol. This means that given names are inserted in the proxy address with no character replacements.

Automatic Character Translation

PROXYGEN performs automatic character translation if a name contains extended characters. In the EDK type, you can use only 7-bit ASCII characters. See the table in the RcGenerateProxy code that performs the translation.

You can use the path that is set up for PROXYGEN to test your own proxy generation DLL. The E-Mail Address Generators (Address Type) property page, under the Recipients node in the Exchange System Manager, shows the display name and path of the proxy generation DLL. For testing, you can edit the proxy address path to point to your own proxy generation DLL. This way you can check if the DLL is generating the correct proxy address without having to install a new address type. If you use this method, however, your DLL must produce addresses that begin with EDK.

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.