Email Migration

Fix UID Out-of-Range Errors in Office 365 IMAP Migration

Kushani NimanthikaKushani Nimanthika Nov 25, 2026 868 views

Question details

The user needs to troubleshoot UID errors that interrupt an IMAP migration to Office 365.

Fix UID Out-of-Range Errors in Office 365 IMAP Migration
Product
Microsoft 365 Exchange Online IMAP migration
Device & OS
not provided
Scenario
Migrating mailboxes from a source IMAP server to Exchange Online.
Observed behavior
The migration fails with errors such as MigrationMRSPermanentException, UidNotPresentInResponseException, or UidOutOfRangePermanentException.
Before you start

Obtain the source IMAP server's fully qualified domain name, port, and security settings from the email provider. Ensure you have the permissions needed to connect to Exchange Online PowerShell and view the migration batch.

Solution 1Recommended

Test the source IMAP server connection

Use Exchange Online PowerShell to check whether the migration service can reach the source server with the specified settings.

1
Confirm the server settings

Check the source email provider's IMAP settings for the server name, port, and security type. Use the settings supplied by the provider rather than assuming a particular port or security combination.

2
Connect to Exchange Online

Open PowerShell, load the Exchange Online PowerShell module, and run Connect-ExchangeOnline. Sign in with an account authorized to manage the migration.

3
Test server availability

Run Test-MigrationServerAvailability -IMAP -RemoteServer <IMAP-server-FQDN> -Port <port> -Security <None, Ssl, or Tls>, replacing the placeholders with the provider's settings. For example, use port 993 with Ssl only if the provider specifies that combination.

4
Correct any connection errors

Review the command output. If the test fails, check the server name, port, security settings, and any firewall restrictions with the source email provider, then run the test again.

Test the source IMAP server connection
A successful connection test is not a complete diagnosis: Server availability does not confirm that every mailbox returns valid UID responses. If the test succeeds but migration still fails, investigate the affected mailbox with the source provider.
Free Microsoft Office alternative

Use WPS Office to Organize Migration Records

WPS Office is a free, lightweight, easy-to-use Microsoft Office alternative with a familiar interface. Open compatible Office files to review migration records and move between office suites without changing your existing file formats. WPS Office does not fix or perform Exchange Online IMAP migrations.

Track mailbox migration status in spreadsheetsOpen and edit Microsoft Office formats including DOCX, XLSX, and PPTXWork in a familiar interface that makes moving from Microsoft Office easierUse a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

What does a UID out-of-range error mean during IMAP migration?

It indicates a problem involving message identifiers in the source IMAP response. Check server connectivity and settings first, then ask the source provider to investigate the affected mailbox if the error persists.

How do I test the IMAP server from Exchange Online?

Connect to Exchange Online PowerShell and run Test-MigrationServerAvailability with the -IMAP, -RemoteServer, -Port, and -Security parameters using the source provider's settings.

Which IMAP port and security setting should I use?

Use the combination specified by the source email provider. Port 993 commonly uses SSL, but the provider's configuration is the authoritative source for your server.

What should I do if the server test succeeds but migration still fails?

Open the migration batch in the Exchange admin center, record the affected mailbox and error details, and ask the source provider to check its IMAP responses and logs.