Launch offer: 20% off every migration plan until 31 January 2027. See prices
//IMAP → Microsoft 365
7 min read
Cross-platform·Cross-Platform

IMAP → Microsoft 365

Migrate email from any IMAP server — Gmail personal, Zoho, cPanel, Dovecot — into Exchange Online.

IMAP to Microsoft 365 Migration Guide

Migrate email from any IMAP-compatible mail server to Microsoft 365 Exchange Online. IMAP migration works with a wide range of source mail systems including Gmail (personal), Yahoo Mail, Zoho Mail, cPanel-hosted mail, Dovecot, Cyrus, and others.


Prerequisites

Source mail server

  • IMAP access enabled on the source mail server
  • IMAP host address, port (typically 993 for SSL or 143 with STARTTLS), and SSL/TLS settings
  • Either:
    • Admin credentials — a master account with read access to all mailboxes (recommended), or
    • Per-user credentials — individual username and password for each user (required if no master account exists)
  • Firewall rules allow outbound IMAP connections from the Aatrex host

Destination (Microsoft 365)

  • Global Administrator role
  • Exchange Online Plan 1 or Plan 2 licences assigned to all target users
  • Destination mailboxes pre-created (users must exist in M365 before migration)

Limitations specific to IMAP

  • Calendars, contacts, and tasks are not migrated — IMAP only supports email (the MAPI protocol is required for other workloads)
  • Folder permissions and delegates are not migrated
  • Mail rules and signatures are not migrated
  • Read/unread status is preserved; message send timestamps are preserved; folder structure is preserved

Step 1: Verify IMAP Connectivity

Before creating a project, confirm your IMAP server is reachable:

  1. Note your IMAP hostname (e.g. mail.yourtenant.com), port (993), and whether SSL/TLS or STARTTLS is required.
  2. Test connectivity using an IMAP client (e.g. Thunderbird) with a known account before proceeding.

Step 2: Register an App in the Destination Tenant

Aatrex writes to Exchange Online via Microsoft Graph.

  1. Sign in to portal.azure.com as a Global Administrator.
  2. Go to Azure Active Directory → App registrations → New registration.
  3. Name it Aatrex IMAP Destination and click Register.
  4. Copy the Application (client) ID and Directory (tenant) ID.
  5. Generate a Client secret and copy the value.
  6. Add the following Application permissions under Microsoft Graph:
PermissionWhy it is needed
Mail.ReadWriteWrite email messages into destination mailboxes
MailboxSettings.ReadWriteSet timezone and language settings
User.Read.AllResolve destination user UPNs
  1. Click Grant admin consent and confirm all permissions show Granted.

Step 3: Create a Migration Project

  1. In Aatrex, click Projects → Create Project.
  2. Select IMAP to Microsoft 365 Migration as the migration type.
  3. On the Source credentials step:
    • Connection type: IMAP
    • Host: IMAP hostname (e.g. mail.yourtenant.com)
    • Port: 993 (or as required by your server)
    • SSL/TLS: Enabled (recommended)
    • Authentication: Select Admin account (if your server supports master credentials) or Per-user credentials
    • Admin username / password: Enter the master account credentials if using admin authentication
  4. On the Destination credentials step, paste the M365 App ID, Tenant ID, and Client Secret.
  5. Click Test Connection → Save Project.

Step 4: Add Users (Per-User Credentials Mode)

If your IMAP server does not support a master account:

  1. Open your project and click Scan → Import Users.
  2. Upload a CSV file with the following columns:
    source_email, source_password, destination_upn
    
    Example:
    john.smith@oldmail.com, P@ssw0rd123, john.smith@yourtenant.com
    
  3. Aatrex validates each credential against the IMAP server and flags any that fail.

Step 5: Discover Users (Admin Account Mode)

If your server supports a master admin account:

  1. Click Scan → Discover Users.
  2. Aatrex queries the IMAP server for all available mailboxes and lists them with display name and mailbox size.
  3. Click Auto Map to match source to destination by username.

Step 6: Start Migration

  1. Select users and click Migrate.
  2. Choose a mode:
    • Full — migrates all mail folders and messages.
    • Date range — migrates messages received after a specified date. Use for incremental pre-cutover passes.
  3. Click Start Migration.

Tip: Run a full migration pass several days before cutover, then run a date-range incremental pass in the final 24–48 hours to capture mail received during migration.


Step 7: MX Record Cutover

When all users are migrated and the final incremental pass is complete:

  1. Update your domain's MX record to point to Microsoft 365:
    • New value: yourtenant-com.mail.protection.outlook.com
    • TTL: 300 seconds (lower this 48 hours before cutover for faster propagation)
  2. Update SPF record to include include:spf.protection.outlook.com.
  3. Add DKIM signing via the Microsoft 365 Defender portal.
  4. Allow 24–48 hours for DNS changes to propagate globally.

Common Issues

IMAP connection refused Check that port 993 (or your configured port) is open from the Aatrex host to your mail server. Verify the hostname resolves correctly.

Authentication fails for all users If using admin credentials, confirm the admin account has master/proxy access. Some IMAP servers (cPanel, Plesk) require the format user%domain.com*adminuser for master authentication — check your server documentation.

Folders appear flat (no nesting) after migration Some IMAP servers use a flat folder structure with / or . as the hierarchy separator. Aatrex reconstructs folder hierarchy from the folder name path. If folders appear incorrectly nested, contact Aatrex support with the IMAP folder list output.

Large attachments slow or failing IMAP servers may enforce attachment size limits per session. Aatrex chunks downloads, but some servers time out long sessions. Reduce the Aatrex concurrent migration thread count in Settings → Migration Settings if timeouts are frequent.

PreviousPST Files → Microsoft 365 or Google WorkspaceNext Microsoft 365 → Google Workspace

Related articles