Exchange Online error

The connection to the server imap.contoso.com could not be completed.

An IMAP migration endpoint or batch cannot reach the source mail server because the server name is wrong or does not resolve in public DNS.

Checked 4 Nov 2026Official source linked
The connection to the server imap.contoso.com could not be completed.

An IMAP migration endpoint or batch cannot reach the source mail server because the server name is wrong or does not resolve in public DNS.

Why it happens

The IMAP server name (FQDN, the full host name such as imap.contoso.com) entered for the migration is wrong, or it does not resolve in public DNS, so Microsoft 365 cannot find the server.

How to fix it

  1. 1

    Step 1

    In the Exchange admin center, go to Migration endpoints and check the FQDN on the IMAP endpoint. See find your IMAP settings.

  2. 2

    Step 2

    If the name is wrong, recreate the endpoint with a publicly resolvable FQDN.

  3. 3

    Step 3

    If the name is right but does not resolve, create a DNS A record that points the FQDN to the IMAP server's public IP address.

  4. 4

    Step 4

    If you instead see The connection to the server ... timed out, a firewall is blocking IMAP. Test port 993 or 143 with telnet and open the port.

telnet imap.contoso.com 993

Source

Full guide: How to migrate IMAP email to Microsoft 365 →