Exchange Provider::CreateSMTPDomain

The CreateSMTPDomain method allows you to create or modify a recipient policy to contain the customer's Simple Mail Transfer Protocol (SMTP) domain (for example, litware.com). The domains implementing these policies are replicated from Active Directory directory service to the metabase by the Exchange Server. This enables delivery of e-mail to users with the same right-hand side of their SMTP address (for example, johnc@litware.com).

Note

The number of domains per recipient policy is subject to the same limitations as Global Address Lists (GALs), which is less than 800 domains. The CreateSMTPDomain method verifies that the caller is not exceeding this limit.

If a recipient policy name is specified but the policy does not exist, the policy is created and the SMTP domain is added. If the policy exists, the SMTP domain is appended to the current list. If the selected policy exists but the 800 domain limit has been reached on that policy, and other recipient policies also exist, a different recipient policy will be chosen by specifying the next policy based on a hash +1.

If no policy name is specified, a hash is done against the domain name to generate a policy name. The name has the format "Policyxxx" where xxx is some number between 0 and 999 by default. The number of recipient policies that are allowed to be created can be changed. The registry key to modify this is as follows:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange Hosting 
Value name: MaxPolicies 
Data type: REG_DWORD 

Arguments

Input argument Required Description

SMTPDomains/SMTPDomain

Yes

Required parameter; the SMTP domain(s) to be added to the recipient policy.

PolicyName

No

Optional parameter; the name of recipient policy. The default name will use the existing hash.

Remarks

Rollback Calls

The CreateSMTPDomain method calls the DeleteSMTPDomain method on transaction rollback.

Comments

For the CreateSMTPDomain method, the following must be supported:

  • Third-level domains (for example, exchange.microsoft.com).

  • Multiple SMTP domains per recipient policy.

  • Graceful failure if too many recipient policies are created.

Sample Code

Example XML Request

The following is an example of an XML request for the CreateSMTPDomain method of the Exchange Provider:

<request> 
    <data/> 
        <procedure> 
            <execute namespace='Exchange Provider' 
             procedure='CreateSMTPDomain'> 
                <executeData> 
                    <SMTPDomains> 
                        <SMTPDomain>litware.com</SMTPDomain> 
                         </SMTPDomains> 
                  <policyName>litware</policyName> 
             </executeData> 
         </execute> 
        </procedure> 
</request> 

Example XML Response

No example XMlL response.

Applies To

Exchange Provider API for:

  • Hosted Messaging and Collaboration version 3.5

  • Hosted Messaging and Collaboration version 3.0

See also

Tasks

Exchange Provider::DeleteSMTPDomain