How do I relay email to my on prem server when 365 account has the same address?

Admin Coterena 0 Reputation points
2025-10-16T07:44:28.4433333+00:00

Greetings,

I'm having a bit of trouble relaying emails sent to users who have a 365 mail box with the same address as their main on-prem account.

If j<PII: moderator removed> exists on both 365 mail box and on prem servers, when another 365 user sends an email to J<PII: moderator removed>, he will only receive it on his 365 mailbox and not on his "main" on prem one.

I've set up "company" domain to be InternalRelay and also set up a Connector to relay emails, but they keep getting sent only to 365.

Can I delete de mail box without deleting the user?

Is there a config that I'm not seeing?

A customer has said that when they work with 365 the default behavior they see is that their recipients get their emails to their on-prem accounts.

Thank you for your comments

Exchange | Hybrid management
Exchange | Hybrid management
The administration of a hybrid deployment that connects on-premises Exchange Server with Exchange Online, enabling seamless integration and centralized control.
{count} votes

1 answer

Sort by: Most helpful
  1. TiNo-T 7,860 Reputation points Microsoft External Staff Moderator
    2025-10-16T09:11:04.4866667+00:00

    Dear @Admin Coterena,

    Please understand that our forum is a public platform, and we will modify your question to cover the personal information of your organization in the description. Kindly ensure that you hide these personal or organization information next time you post error or some information to protect personal data. 

    Welcome to Microsoft Q&A Forum! 

    Thank you for your message regarding the mail flow issue between Office 365 and your on-premises Exchange environment. Based on your description, it appears that the user ******@XXXX.com currently has two mailboxes, one in Exchange Online (Office 365) and one on-premises, and they have the same email address. This configuration may not supported by Microsoft, and it may lead to mail delivery issues, such as emails being delivered only to the cloud mailbox. 

    Microsoft recommends that each user should have only one mailbox, either in Exchange Online or on-premises, to avoid such conflicts. You can refer to the official guidance here: How to recover when a mailbox exists in both Exchange Online and on-premises - Exchange | Microsoft… 

    User's image

    Also, you can consult more information in the link above (please kindly check scenario 2) and combine with suggested article in that section: Permanently Clear Previous Mailbox Info | Microsoft Community Hub 

    User's image

    Besides that, if your goal is to keep mail delivery on-premises, I recommend removing the cloud mailbox and ensuring proper hybrid configuration so that Office 365 routes mail to your on-prem Exchange server. Here are several steps to resolve it (remove cloud mailbox, route to on-prem): 

    These steps assume a hybrid setup with Azure AD Connect syncing users from on-prem. Backup any data in the cloud mailbox first (e.g., export to PST), as this permanently deletes it. Please kindly run this test on a non-production user if possible (doing these in Exchange Online). 

    1.Remove the Exchange Online license:     

    • Go to the Microsoft 365 admin center > Users > Active users.     
    • Select the user (******@XXXX.com).     
    • Under Licenses and apps, uncheck the Exchange Online license (or the bundle containing it, like Microsoft 365 E3/E5).     
    • Save changes. This converts the mailbox to a "soft-deleted" state but leaves residual info. 

    2.Connect to Exchange Online PowerShell:     

    • Install the Exchange Online PowerShell module if needed (Install-Module -Name ExchangeOnlineManagement).     
    • Run: `Connect-ExchangeOnline -UserPrincipalName ******@company.com` 

    3.Verify the user's current state (optional but recommended):     

    • Run: `Get-User ******@XXXX.com | Select Name, *Recipient*`     
    • Look for PreviousRecipientTypeDetails showing "UserMailbox". This confirms residual mailbox info. 

    4.Permanently clear the previous mailbox info:     

    • Run: `Set-User -Identity ******@XXXX.com -PermanentlyClearPreviousMailboxInfo`     
    • Confirm with "Y" when prompted. This deletes all pointers to the old cloud mailbox (GUID, home MDB), making the data unrecoverable.     
    • Wait up to 24 hours for full processing, but mail flow should improve sooner. 

    5.Force Azure AD Connect sync (if needed, to update the cloud object):     

    • On your on-prem sync server, run: `Start-ADSyncSyncCycle -PolicyType Delta`     
    • This ensures the cloud object gets updated with on-prem attributes, setting it as a MailUser with the remote routing address. 

    6.Test mail flow:     

    • Send an email from a cloud user to ******@XXXX.com.     
    • It should now relay via your outbound connector to the on-prem mailbox.     
    • Monitor with `Get-MessageTrace` in Exchange Online PowerShell. 

    If the duplicate was caused by a sync issue (e.g., missing ExchangeGUID from on-prem), check your Azure AD Connect health and ensure the on-prem mailbox has a valid GUID (Get-Mailbox jXXX | fl ExchangeGuid). If problems persist after this, re-run the Hybrid Configuration Wizard to validate connectors and domains. 

    I hope this information can help you in this case and please kindly correct me if I misunderstand your concern. Wish you a pleasant day! 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.