Changing the default domain in DSNs for Exchange 2000 (SP3 or greater) and Exchange 2003


Some customers running Exchange are responsible for multiple SMTP domains in their org.  For example, they are running a single Exchange server at a corporate level, but their individual branches have their own SMTP domain.  That way, when people do business with them at a local level, it looks like a local community business, as opposed to a huge corporation.  This works great, however with this topology, if a person types a wrong email address (no_user@localbus.com), the NDR response comes from the main SMTP domain at the corporate level (i.e.  admin@bigcorp.com)


The default DSN sink generator appends the default domain of the exchange organization to “From: postmaster@” and that forms the 822 from of the DSN message. You can override this domain, by implementing a transport event sink.


The interface the event sink will need to implement is as follows: You will need exchange 2000 SP3 or Exchange 2003. This interface is defined in smtpevent.idl. You will need other transport idl files to implement this transport event sink. All of them should be available in IIS Platform SDK available at http://www.microsoft.com/msdownload/platformsdk/sdkupdate/.


interface IDSNGenerationSink : IUnknown
{
HRESULT OnSyncGenerateDSN(


    [in]  ISMTPServer                 *pISMTPServer,
    [in]  IDSNSubmission              *pIDSNSubmission,
    [in]  IMailMsgProperties          *pIMsg,
    [in]  IMailMsgPropertyBag         *pIDSNProperties,
    [in]  IDSNRecipientIterator       *pIRecipIter);
}


You can implement a higher priority sink. Implement this interface and you really need to handle only this method in the interface listed above.


You will need to override the value in this property DSNPROP_SZ_DEFAULTDOMAIN. This property is also defined in smtpevent.idl. Use the pIDSNProperties->PutStringA to set and override the default value, to specify the domain that you really want.
Just return S_OK from there.


- Pretish Abraham


[Updated to correct typo related to version requirements, thanks for pointing it out]

Comments (5)
  1. Rick says:

    would be nice to change the domain the postmaster account is going out as in the ESM

  2. Devin says:

    Exchange 2003 SP3?

  3. KC Lemson says:

    Rick – thanks for the suggestion, Pretish opened a tracking bug for that feature request.

  4. Anonymous says:

    Exchange-faq.dk – Din portal til Microsoft Exchange Server information

  5. Victor says:

    There exists a commercial application named RightPostmaster for Exchange 2000/2003.

Comments are closed.

Skip to main content