Anavem
Languagefr
Fix Exchange Migration Error – Target Mailbox SMTP Proxy Missing – Exchange Online 2026
Fix GuideTarget mailbox doesn't have an SMTP proxy matchingExchange Online Migration

Fix Exchange Migration Error – Target Mailbox SMTP Proxy Missing – Exchange Online 2026

Exchange mailbox migration fails when target mailbox lacks required onmicrosoft.com SMTP proxy address. Fix by adding missing proxy addresses using PowerShell cmdlets or bulk scripts.

April 14, 2026 12 min
Target mailbox doesn't have an SMTP proxy matchingExchange Online Migration 5 methods 12 min
Instant Solution

The fastest solution is to bulk add the missing <domain>.mail.onmicrosoft.com SMTP proxy addresses to all affected mailboxes using PowerShell. Run Get-Mailbox -ResultSize Unlimited -Filter {EmailAddresses -notlike "*@yourdomain.mail.onmicrosoft.com"} | Set-Mailbox -EmailAddresses @{add="youralias@yourdomain.mail.onmicrosoft.com"} in Exchange Management Shell.

Understanding Exchange Migration SMTP Proxy Errors

Exchange mailbox migrations to Microsoft 365 can fail when target mailboxes lack the required SMTP proxy addresses matching the tenant's onmicrosoft.com domain. This error typically occurs during hybrid Exchange deployments when migrating from on-premises Exchange servers to Exchange Online.

The error "Target mailbox doesn't have an SMTP proxy matching" indicates that the source mailbox in your on-premises Exchange environment is missing the crucial proxy address that Exchange Online uses for mail routing. Every mailbox being migrated must have an SMTP proxy address in the format username@yourdomain.mail.onmicrosoft.com to ensure proper mail flow and migration success.

This issue commonly affects organizations during their Microsoft 365 migration journey, particularly those with custom email address policies or incomplete hybrid configurations. The problem can impact individual mailboxes or entire migration batches, causing significant delays in cloud adoption projects. Understanding the root causes and implementing the correct fixes ensures smooth mailbox transitions and maintains business continuity during the migration process.

Diagnostic

Symptoms

  • Mailbox migration status shows as "Failed" in Exchange Admin Center
  • Error message: "Target mailbox doesn't have an SMTP proxy matching '<domain>.mail.onmicrosoft.com'"
  • Migration batch reports incomplete with proxy address errors
  • Hybrid configuration wizard shows connectivity issues
  • PowerShell migration commands return proxy matching errors
  • Exchange Online mailboxes cannot receive mail from on-premises
Analysis

Root Causes

  • Source mailbox missing required <domain>.mail.onmicrosoft.com SMTP address
  • Azure AD Connect not syncing proxy addresses correctly
  • Manual mailbox creation without proper SMTP proxy configuration
  • Incomplete hybrid configuration missing routing domains
  • Directory synchronization filtering excluding proxy addresses
  • Custom recipient policies overriding default proxy generation
Resolution Methods

Solutions

01

Add Missing SMTP Proxy Using Exchange Management Shell

This method adds the missing SMTP proxy address to individual mailboxes using Exchange PowerShell commands.

  1. Open Exchange Management Shell as administrator on your Exchange server
  2. Connect to your on-premises Exchange environment:
    Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
  3. Identify mailboxes missing the proxy address (replace 'yourdomain' with your actual tenant name):
    Get-Mailbox -ResultSize Unlimited -Filter {EmailAddresses -notlike "*@yourdomain.mail.onmicrosoft.com"} | Select-Object UserPrincipalName,Alias
  4. Add the missing SMTP proxy to a single mailbox:
    Set-Mailbox -Identity "username@domain.com" -EmailAddresses @{add="username@yourdomain.mail.onmicrosoft.com"}
  5. Verify the proxy was added:
    Get-Mailbox -Identity "username@domain.com" | Select-Object -ExpandProperty EmailAddresses
Pro tip: Replace 'yourdomain' with your actual Microsoft 365 tenant prefix found in your admin portal.
02

Bulk Add SMTP Proxies Using PowerShell Pipeline

This method efficiently adds the missing SMTP proxy addresses to all affected mailboxes in a single operation.

  1. Launch Exchange Management Shell with administrative privileges
  2. Run the bulk update command (replace 'yourdomain' with your tenant name):
    Get-Mailbox -ResultSize Unlimited -Filter {EmailAddresses -notlike "*@yourdomain.mail.onmicrosoft.com"} | ForEach-Object { Set-Mailbox -Identity $_.Identity -EmailAddresses @{add="$($_.Alias)@yourdomain.mail.onmicrosoft.com"} }
  3. Monitor the progress and check for any errors in the output
  4. Verify all mailboxes now have the proxy address:
    Get-Mailbox -ResultSize Unlimited | Where-Object {$_.EmailAddresses -like "*@yourdomain.mail.onmicrosoft.com"} | Measure-Object
  5. Force directory synchronization to update Azure AD:
    Start-ADSyncSyncCycle -PolicyType Delta
Warning: Test this command on a small subset of mailboxes first to ensure proper functionality.
03

Use PowerShell Script for Advanced Proxy Management

This method uses a comprehensive PowerShell script to handle complex scenarios and provide detailed logging.

  1. Create a new PowerShell script file named Add-SMTPProxy.ps1
  2. Copy the following script content:
    # Exchange SMTP Proxy Addition Script
    param(
        [Parameter(Mandatory=$true)]
        [string]$TenantDomain
    )
    
    $ErrorActionPreference = "Continue"
    $LogFile = "C:\Temp\SMTPProxy-$(Get-Date -Format 'yyyyMMdd-HHmmss').log"
    
    function Write-Log {
        param([string]$Message)
        $Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
        "$Timestamp - $Message" | Tee-Object -FilePath $LogFile -Append
    }
    
    Write-Log "Starting SMTP proxy addition for domain: $TenantDomain"
    
    $MailboxesWithoutProxy = Get-Mailbox -ResultSize Unlimited -Filter {EmailAddresses -notlike "*@$TenantDomain.mail.onmicrosoft.com"}
    
    Write-Log "Found $($MailboxesWithoutProxy.Count) mailboxes without proxy"
    
    foreach ($Mailbox in $MailboxesWithoutProxy) {
        try {
            $ProxyAddress = "$($Mailbox.Alias)@$TenantDomain.mail.onmicrosoft.com"
            Set-Mailbox -Identity $Mailbox.Identity -EmailAddresses @{add=$ProxyAddress}
            Write-Log "SUCCESS: Added proxy $ProxyAddress to $($Mailbox.UserPrincipalName)"
        }
        catch {
            Write-Log "ERROR: Failed to add proxy to $($Mailbox.UserPrincipalName) - $($_.Exception.Message)"
        }
    }
    
    Write-Log "Script completed. Check log file: $LogFile"
  3. Save the script and run it from Exchange Management Shell:
    C:\Scripts\Add-SMTPProxy.ps1 -TenantDomain "yourdomain"
  4. Review the log file for any errors or issues
  5. Verify the results using the verification steps below
04

Fix Azure AD Connect Synchronization Issues

This method addresses synchronization problems that prevent proxy addresses from syncing to Exchange Online.

  1. Open Azure AD Connect on your sync server
  2. Navigate to ConfigureCustomize synchronization options
  3. Verify that Exchange hybrid deployment is enabled
  4. Check the Optional features section and ensure Exchange Mail Public Folders is selected if applicable
  5. Review the Filtering configuration:
    • Go to Domain and OU filtering
    • Ensure all relevant OUs containing mailboxes are selected
  6. Check attribute filtering:
    Get-ADSyncConnectorRunProfile -ConnectorName "domain.com" | Where-Object {$_.Name -eq "Full Synchronization"}
  7. Force a full synchronization:
    Start-ADSyncSyncCycle -PolicyType Initial
  8. Monitor synchronization status:
    Get-ADSyncSyncCycleResult
Pro tip: Check the Azure AD Connect Health portal for detailed synchronization reports and errors.
05

Configure Email Address Policies for Automatic Proxy Generation

This advanced method ensures future mailboxes automatically receive the correct SMTP proxy addresses.

  1. Open Exchange Admin Center and navigate to Mail flowEmail address policies
  2. Create a new email address policy or edit the existing default policy
  3. Click Add email address format and configure:
    • Email address type: SMTP
    • Email address format: @yourdomain.mail.onmicrosoft.com
    • Make this the reply address: Unchecked
  4. Set the policy priority to ensure it applies correctly
  5. Apply the policy to existing mailboxes using PowerShell:
    Get-Mailbox -ResultSize Unlimited | Update-EmailAddressPolicy
  6. Verify the policy application:
    Get-EmailAddressPolicy | Get-Recipient -ResultSize Unlimited | Select-Object Name,EmailAddresses
  7. Test with a new mailbox creation to ensure automatic proxy generation
  8. Update the hybrid configuration to recognize the new routing domain:
    Set-HybridConfiguration -Domains @{Add="yourdomain.mail.onmicrosoft.com"}
Warning: Email address policy changes affect all mailboxes. Test thoroughly in a non-production environment first.
Validation

Verification

After applying any of the above methods, verify the fix using these steps:

  1. Check that all mailboxes now have the required SMTP proxy:
    Get-Mailbox -ResultSize Unlimited | Where-Object {$_.EmailAddresses -notlike "*@yourdomain.mail.onmicrosoft.com"} | Measure-Object
    The count should be zero if all mailboxes have the proxy.
  2. Verify specific mailbox proxy addresses:
    Get-Mailbox -Identity "testuser@domain.com" | Select-Object -ExpandProperty EmailAddresses
  3. Test the migration batch again from Exchange Admin Center or PowerShell:
    Get-MigrationBatch | Get-MigrationUser | Where-Object {$_.Status -eq "Failed"}
  4. Confirm Azure AD synchronization completed successfully:
    Get-ADSyncSyncCycleResult | Select-Object Result,StartTime,EndTime
If it still fails

Advanced Troubleshooting

If the above methods didn't resolve the issue, try these advanced troubleshooting steps:

  • Check for duplicate proxy addresses: Run Get-Mailbox -ResultSize Unlimited | Where-Object {($_.EmailAddresses | Where-Object {$_ -like "*@yourdomain.mail.onmicrosoft.com"}).Count -gt 1} to identify conflicts.
  • Verify tenant domain configuration: In Microsoft 365 Admin Center, go to SettingsDomains and confirm your onmicrosoft.com domain is properly configured.
  • Reset hybrid configuration: Run the Hybrid Configuration Wizard again to refresh routing and proxy settings.
  • Check Exchange Online recipient limits: Ensure your tenant hasn't reached mailbox limits that could prevent migration.
  • Review migration endpoint connectivity: Test connection using Test-MigrationServerAvailability -ExchangeRemoteMove -RemoteServer "mail.domain.com" -Credentials (Get-Credential)
  • Clear migration cache: Remove and recreate the migration batch if proxy issues persist after adding addresses.

Frequently Asked Questions

What is the onmicrosoft.com SMTP proxy address and why is it required?+
The onmicrosoft.com SMTP proxy address is a routing address that Microsoft 365 uses internally for mail delivery and mailbox identification. Every Exchange Online mailbox requires this proxy address in the format username@yourdomain.mail.onmicrosoft.com where 'yourdomain' is your tenant's unique identifier. This address ensures proper mail routing between on-premises and cloud environments during hybrid deployments and is essential for migration processes to identify and match source and target mailboxes correctly.
Can I migrate mailboxes without adding the onmicrosoft.com proxy addresses?+
No, you cannot successfully migrate mailboxes to Exchange Online without the required onmicrosoft.com SMTP proxy addresses. The migration process will fail with the error 'Target mailbox doesn't have an SMTP proxy matching' because Exchange Online cannot properly identify and route mail to the target mailbox. The proxy address serves as a unique identifier that links the on-premises mailbox to its corresponding Exchange Online mailbox during the migration process.
How do I find my tenant's onmicrosoft.com domain name?+
You can find your tenant's onmicrosoft.com domain in several ways: 1) Log into the Microsoft 365 Admin Center and go to Settings → Domains to see your default domain, 2) Check your Azure AD tenant properties in the Azure portal, 3) Run the PowerShell command Get-AcceptedDomain in Exchange Online PowerShell to list all accepted domains including your onmicrosoft.com domain, or 4) Look at any existing Exchange Online mailbox's proxy addresses using Get-Mailbox | Select-Object -ExpandProperty EmailAddresses.
Will adding onmicrosoft.com proxy addresses affect my users' email addresses?+
No, adding onmicrosoft.com SMTP proxy addresses will not change your users' primary email addresses or affect their ability to send and receive mail. These proxy addresses are secondary addresses used internally by Microsoft 365 for routing and identification purposes. Users will continue to use their regular domain email addresses (like user@company.com) for all email communication. The onmicrosoft.com addresses remain hidden from users and are only used by the Exchange system for backend operations.
What should I do if the PowerShell commands fail with permission errors?+
If you encounter permission errors when running PowerShell commands, ensure you have the necessary administrative rights: 1) Run Exchange Management Shell as Administrator, 2) Verify you have Organization Management or Recipient Management role assignments in Exchange, 3) For Azure AD Connect operations, ensure you're logged in with Global Administrator or Hybrid Identity Administrator roles, 4) Check that your account has the necessary permissions in both on-premises Active Directory and Azure AD, and 5) If using remote PowerShell, verify your execution policy allows script execution using Set-ExecutionPolicy RemoteSigned.

Discussion

Share your thoughts and insights

Sign in to join the discussion