none
Removing ONE domain from Exchange 2007 but still being able to send emails from it. RRS feed

  • Question

  • So we started with a little SBS 2k8 with Exchange 2k7. Now we have migrated email (mostly) to office 365. There are still applications, scripts, etc.. on the SBS server that need to be able to send emails (my daily server status report, for example) which needs to go to me@mydomain.com. But the SBS server shouldn't /receive/ emails for me@mydomain.com... those should go on to office 365. All the DNS changes have been made with our ISP to send those emails to the new office 365, and that all works nicely for emails from outside our server. But any email generated inside our server, stays in the sever... because it thinks it's the server for mydomain.com.

    Does that make sense? I need to retain the ability to send emails from the local SB server, but I want those to go out to the office 365 servers. 

    I /think/ the correct way to do that is to go into Exchange Management Console, Organization, Hub Transport, Accepted Domains... then double click mydomain.com and change it to "External Relay Domain: E-mail is relayed to an e-mail server outside this Exchange organizatino by the Edge Transport server. When I try to do that I get:

    --------------------------------------------------------
    Microsoft Exchange Error
    --------------------------------------------------------
    The following error(s) occurred while saving changes:

    set-accepteddomain
    Failed
    Error:
    Cannot remove the domain 'mydomain.com' because it is referenced by the proxy address template 'SMTP:%1g%1s@mydomain.com'.


    Which leads me to some pretty freaking editing in:
    https://support.microsoft.com/en-us/kb/2741195

    and I don't want to do that until I'm sure that's the right way to handle this setup. 

    There must be other people out there who have moved one domain to outlook 365, but still want to keep their local exchange server running for other things... How do we do that?

    Monday, November 16, 2015 10:13 PM

Answers

  • If you want to remove all addresses, simply remove the policy using Remove-EmailAddressPolicy.  If it's the default policy, you won't be able to remove it since I believe you need one.  In that case, just substitute another policy such as "SMTP:%m@clownpenis.fart".  You can add that bogus domain to your accepted domains as well if you want.

    That said, the best way to do what you want to do is to forget all of that and instead create specific e-mail domains for each side and assign each addresses in the shared domain and an address in the specific domain.  Then create contacts for those recipients in the other domain.

    For example, in domain A, say you have a mailbox with address joe@mydomain.com.  Add the proxy address joe@a.com to that mailbox.

    In domain B, create a contact with target address joe@a.com.  You might also add the proxy address joe@mydomain.com to that contact.  Add a send connector for address space a.com pointing to the domain A Exchange server.

    Say in domain B you have a mailbox with address jane@mydomain.com.  Add the proxy address joe@b.com to that mailbox.

    In domain A, create a contact with target address jane@b.com.  You might also add the proxy address jane@mydomain.com to that contact.  Add a send connector for address space b.com pointing to the domain B Exchange server.

    This is by far the best way to do this.  Trying to depend on unresolved addresses to determine mail routing is a great way to completely confuse everything in your environment.  Unless you have a relatively small number of recipients, this would mean that you would need some sort of directory synchronization.  I've written these kinds of scripts, and you can get help or samples on the Internet for that, or you can also find third-party tools that do it.


    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."
    Celebrating 20 years of providing Exchange peer support!


    Wednesday, November 18, 2015 6:28 AM
    Moderator

All replies

  • Remove that address template from all e-mail address policies.

    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."
    Celebrating 20 years of providing Exchange peer support!

    • Proposed as answer by Prem P Rana Saturday, November 28, 2015 5:01 PM
    Tuesday, November 17, 2015 12:14 AM
    Moderator
  • Thanks Ed. When you say "all e-mail address policies." do you mean that I should do that via the method in 

    https://support.microsoft.com/en-us/kb/2741195

    or do you have another way of doing that? I'm asking because the method listed there is scary:

    "Warning If you use the Active Directory Service Interfaces (ADSI) Edit snap-in, the LDP utility, or any other LDAP client to incorrectly change the attributes of Active Directory objects, you can cause serious problems. These problems may require you to reinstall Windows Server and Microsoft Exchange Server. Microsoft cannot guarantee that problems that occur if you incorrectly change Active Directory object attributes can be resolved. Change these attributes at your own risk.
    1. Click Start, and then click Run.
    2. In the Open box, type Adsiedit.msc and then click Ok.
    3. Right-click ADSI Edit, and then click Connect to.
    4. In the Select a well know Naming Context list, select Default naming context. In the Select or type a domain or server box, type the FQDN of a Domain Controller server, and then click Ok.
    5. Expand Configuration [dc.domain.com], expand CN=Configuration,DC=domain,DC=com, expand CN=Services, expand CN=Microsoft Exchange, expand CN=<Your Organization>, and then click CN=Recipient Policies.
    6. In the Action pane, right-click the CN=Default Recipient policy, and then select Properties.
    7. In the Attributes list, double-click gatewayProxy, and then remove the SMTP email address that is referenced by the accepted domain from the Values box.
    8. In the Attributes list, double-click DisabledgatewayProxy, and then remove the SMTP email address that is referenced by the accepted domain from the Values box.
    9. If you have multiple recipient policies, check every recipient policy, and then remove the SMTP email address.

    Tuesday, November 17, 2015 12:20 AM
  • I would just use Get-EmailAddressPolicy and Set-EmailAddressPolicy.  Should be a whole lot easier and less risky.  I'm not sure why you're looking at ADSI Edit.

    https://technet.microsoft.com/en-us/library/bb124117

    https://technet.microsoft.com/EN-US/library/bb124517(v=exchg.160).aspx


    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."
    Celebrating 20 years of providing Exchange peer support!

    • Proposed as answer by Niko.ChengModerator Tuesday, November 17, 2015 7:32 AM
    • Unproposed as answer by James Newton Tuesday, November 17, 2015 6:05 PM
    • Proposed as answer by Prem P Rana Saturday, November 28, 2015 5:01 PM
    Tuesday, November 17, 2015 3:05 AM
    Moderator
  • Again, thanks for taking the time, but now I'm more confused than ever... When I use Get-EmailAddressPolicy, I see no mention of mydomain.com at all:

    [PS] C:\Windows\system32>Get-EmailAddressPolicy
    
    Name                       Priority                   RecipientFilter
    ----                       --------                   ---------------
    Default Policy             Lowest                     Alias -ne $null
    Windows SBS Email Address  1                          Alias -ne $null
    Policy

    If there is no mention of the domain, how the heck do I remove it?

    I was looking at 

    https://support.microsoft.com/en-us/kb/2741195

    because that's what came up on a search for the error message: Cannot remove the domain referenced by the proxy address template 

    When I look at CN=Default Recipient policy, and then select Properties, I DO see SMTP:@mydomain.com under the gatewayProxy. I don't see it under DisabledGatewayProxey

    Tuesday, November 17, 2015 8:14 PM
  • Get-EmailAddressPolicy | FL

    You will see the value of the EnabledEmailAddressTemplates and EnabledPrimarySMTPAddressTemplate properties.  Change the ones you need to change using Set-EmailAddressPolicy.

    https://technet.microsoft.com/en-us/library/bb124517%28v=exchg.160%29.aspx?f=255&MSPPError=-2147217396


    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."
    Celebrating 20 years of providing Exchange peer support!

    • Proposed as answer by Prem P Rana Saturday, November 28, 2015 5:01 PM
    Tuesday, November 17, 2015 9:03 PM
    Moderator
  • Wow...

    so it looks like I have:

    EnabledPrimarySMTPAddressTemplate : %1g%1s@mydomain.com
    
    EnabledEmailAddressTemplates      : {SMTP:%1g%1s@mydomain.com, smtp:%g.%s@mydomain.com, smtp:%m@mydomain.com}

    under the "Windows SBS Email Address Policy" identity. The Default identity has the same sort of thing but with mydomain.local.

    So am I doing something like:

    Set-EmailAddressPolicy -Identity "Windows SBS Email Address Policy" -EnabledPrimarySMTPAddressTemplate ""
    
    Set-EmailAddressPolicy -Identity "Windows SBS Email Address Policy" -EnabledEmailAddressTemplates ""


    Tuesday, November 17, 2015 9:52 PM
  • If you want to remove all addresses, simply remove the policy using Remove-EmailAddressPolicy.  If it's the default policy, you won't be able to remove it since I believe you need one.  In that case, just substitute another policy such as "SMTP:%m@clownpenis.fart".  You can add that bogus domain to your accepted domains as well if you want.

    That said, the best way to do what you want to do is to forget all of that and instead create specific e-mail domains for each side and assign each addresses in the shared domain and an address in the specific domain.  Then create contacts for those recipients in the other domain.

    For example, in domain A, say you have a mailbox with address joe@mydomain.com.  Add the proxy address joe@a.com to that mailbox.

    In domain B, create a contact with target address joe@a.com.  You might also add the proxy address joe@mydomain.com to that contact.  Add a send connector for address space a.com pointing to the domain A Exchange server.

    Say in domain B you have a mailbox with address jane@mydomain.com.  Add the proxy address joe@b.com to that mailbox.

    In domain A, create a contact with target address jane@b.com.  You might also add the proxy address jane@mydomain.com to that contact.  Add a send connector for address space b.com pointing to the domain B Exchange server.

    This is by far the best way to do this.  Trying to depend on unresolved addresses to determine mail routing is a great way to completely confuse everything in your environment.  Unless you have a relatively small number of recipients, this would mean that you would need some sort of directory synchronization.  I've written these kinds of scripts, and you can get help or samples on the Internet for that, or you can also find third-party tools that do it.


    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."
    Celebrating 20 years of providing Exchange peer support!


    Wednesday, November 18, 2015 6:28 AM
    Moderator