Address Rewriting not working on outbound mail

Hello, I have setup an Edge Transport server between Office 365/EOP and our internal mail servers (Non-Exchange). For this, I have setup two receive connectors and two send connectors on the Edge server. Mail flow in and out is working fine.

I enabled Address Rewriting agents for both inbound and outbound. Then I made an address rewrite entry. The entry works fine for inbound mail. The address @contosco.com is changed to @anotherdomain.com and routed appropriately. However, when I send an email from @anotherdomain.com back to outside word, it is not rewritten to @contosco.com. 

Here are the commands I used to setup the connectors:

New-ReceiveConnector -Name "From Internal to Edge" -Usage Internal -AuthMechanism ExternalAuthoritative -PermissionGroups AnonymousUsers, ExchangeServers -RemoteIpRanges <Internal Subnets> -ProtocolLogging Verbose
New-SendConnector -Name "From Edge to Internal" -Usage Internal AddressSpaces <domains> -ProtocolLogging Verbose
New-SendConnector -Name "From Edge to EOP" -AddressSpaces * -RequireTLS $True -SmartHosts <organization>.mail.protection.outlook.com -ProtocolLogging Verbose
New-ReceiveConnector -Name "From EOP to Edge" -Usage Custom -AuthMechanism TLS  -PermissionGroups AnonymousUsers -RemoteIpRanges $ip.DataCenterIPs -RequireTLS $True -Bindings <ip address of server>:25 -ProtocolLogging Verbose

Note that EdgeSync is not used as the internal mail servers are not Exchange only.

Any ideas?


March 27th, 2015 3:24pm

Hi 

Try  running the below commands and see  that the address rewrite entry outbound agent is enabled 

Get-AddressRewriteEntry
Get-AddressRewriteEntry "Rewrite Contoso.com to Northwindtraders.com" | Format-List


Free Windows Admin Tool Kit Click here and download it now
March 29th, 2015 2:06am

There is no way to disable the outbound agent on a Address Rewrite Entry. You can enable or disable the inbound by use the flag -OutboundOnly to $true or $false. Changing that setting makes no difference to outbound mail.

Here are the results when I run the Get command

[PS] C:\Windows\system32>Get-AddressRewriteEntry -Identity "Rewrite This" | fl


InternalAddress   : xxx@contoso.com
ExternalAddress   : xxx@anotherdomain.com
ExceptionList     : {}
OutboundOnly      : False
AdminDisplayName  :
ExchangeVersion   : 0.1 (8.0.535.0)
Name              : My Venue Photos
DistinguishedName : CN=My Venue Photos,CN=Email Entries,CN=Address Rewrite Configuration,OU=MSExchangeGateway
Identity          : CN=My Venue Photos,CN=Email Entries,CN=Address Rewrite Configuration,OU=MSExchangeGateway
Guid              : c1c72ede-4906-437a-985c-980547083514
ObjectCategory    : CN=ms-Exch-Address-Rewrite-Entry,CN=Schema,CN=Configuration,CN={FC0B799A-A64B-4A2F-BA0D-AF0D1646F37
                    5}
ObjectClass       : {top, msExchAddressRewriteEntry}
WhenChanged       : 3/27/2015 2:27:53 PM
WhenCreated       : 3/25/2015 10:45:45 AM
WhenChangedUTC    : 3/27/2015 7:27:53 PM
WhenCreatedUTC    : 3/25/2015 3:45:45 PM
OrganizationId    :
OriginatingServer : localhost
IsValid           : True
ObjectState       : Unchanged

March 29th, 2015 6:34pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics