Exchange SMTP Relay Alternative/Workaround
2011-06-21 Initial Post
Exchange Server 2003 SP2
Exchange Server 2010 SP1
I don’t recall specifically reading about this anywhere, but I thought about this last week when we had a request to allow an application server to relay e-mail messages to an external domain. It made sense and I tested it out and it work as expected. Here's what happened:
If you have an application server that needs to send e-mail outside your organization, you can either allow that application server to relay, or you can create a contact entry for the external e-mail address. If the application server only needs to send to a few external addresses, creating contacts for each would be preferred over allowing the application server to relay.
During creation of the contact entry, Exchange automatically includes an additional e-mail address as a secondary SMTP address for the contact. Exchange will generate the additional SMTP address using the alias you specified during contact creation and the address will be based on your Exchange organization’s e-mail address generation policy.
After the contact is created and replicated through AD, the application server will be able to send to the secondary (internal) SMTP address. Exchange will automatically relay the message to the external address. Note that sending to the external address directly will still not work even after the contact is created—you must send to the internal SMTP address.
Here’s an example:
• You create a contact for vendor.billing@external-vendor-domain.com.
• Exchange will create an additional SMTP address of vendor.billing@your-domain.com.
• The application server sends to vendor.billing@your-domain.com (the internal SMTP address) and it gets relayed to vendor.billing@external-vendor-domain.com with no issues.
• If the application server tries to send to the external address of vendor.billing@external-vendor-domain.com, it’ll get a “550 5.7.1 Unable to relay” error.
I tested this as follows (in a mixed Exchange 2003, 2007, and 2010 org):
• Using a VBS with an Exchange Server 2003 bridgehead server of my external SMTP routing connector as the SMTP host.
• Using a PS script with an Exchange Server 2010 Hub Transport server as the SMTP host.
• With both, I first tried sending to the contact’s external address and got the errors below. I then sent to the contact’s internal SMTP address and the message was relayed correctly with no errros.
^ Testing relaying using VBS with an Exchange Server 2003 bridgehead server
^ Testing relaying using PS script with an Exchange Server 2010 Hub Transport server