Migrate
Migrate cPanel Email to Office 365: Generic IMAP Plan
Move any cPanel-hosted mailbox to Office 365 over IMAP. Generic guide for IT admins covering MX, Email Routing, SPF, DKIM, and validation.
Alex Kerr
Lead Migration Engineer, Mailbox Taxi
cPanel runs underneath most low-cost mail hosting on the planet, from Bluehost and HostGator to thousands of small regional hosts you've never heard of. The mail product is consistent: Maildir on a shared Linux box, accessible by IMAP, managed through a cPanel web UI. The reason cPanel-to-Office-365 migrations go wrong is rarely the mail copy itself, it's the two-place MX setting (public DNS plus cPanel's internal Email Routing flag) that catches admins on cutover day. This guide is the generic version that applies regardless of which hosting brand sells you the cPanel underneath.
Skip the manual setup — let Mailbox Taxi handle it
One desktop app, every IMAP provider, zero data leaving your machine.
What "cPanel email" means
cPanel is a Linux server management UI sold by cPanel L.L.C. and bundled by most shared hosting providers. The mail piece consists of:
- Postfix or Exim as the SMTP server
- Dovecot as the IMAP/POP3 server
- Roundcube and/or Horde as the webmail client
- A cPanel UI under "Email" that manages everything above
From a migration perspective, this means every cPanel mail account looks the same from the outside:
- IMAP on
mail.yourdomain.comport 993 SSL - SMTP on the same host port 465 SSL or 587 STARTTLS
- Webmail via the cPanel webmail subdomain
What varies between hosts is the version of cPanel, the layout of the UI, and the per-IP IMAP throttling thresholds. Everything else in this guide applies regardless of which host sells you the cPanel.
Inventory the cPanel side
In cPanel, navigate through these panels and capture everything:
- Email, Email Accounts — every mailbox, current size, quota
- Email, Forwarders — every mail forwarder (one-to-one and one-to-many)
- Email, Email Filters — per-account filter rules
- Email, Autoresponders — vacation messages
- Email, Mailing Lists — distribution lists (if used)
- Email, Default Address — the catch-all
- Email, Track Delivery — recent mail delivery logs (useful for spotting busy mailboxes)
Save it in a spreadsheet. Every entity that exists in cPanel either needs to be migrated (mailboxes) or recreated on Office 365 (forwarders, filters, aliases). Skipping inventory is the most common cause of post-cutover support tickets weeks later.
cPanel passwords are the only authentication
There is no app password layer in cPanel email. The password set in cPanel Email Accounts is what you use for IMAP, SMTP, and webmail. If two-factor authentication is enabled at the cPanel login level, that only protects the cPanel web UI; mail clients keep working with the plain mailbox password. This means for migration you either know the existing password or reset it from cPanel.
Provision Office 365
In the Microsoft 365 admin centre:
- Verify your domain. Microsoft gives you a TXT record. Add it inside cPanel, Domains, DNS Zone Editor (or "Zone Editor" depending on cPanel version).
- Create each user mailbox. Match the SMTP address exactly to the cPanel source.
- Assign Exchange Online licences. Wait 15 to 60 minutes for provisioning.
- Pre-create distribution groups for cPanel mailing lists.
- Pre-create aliases on each user to mirror cPanel forwarders and aliases.
For IMAP authentication into Office 365, plan on OAuth2 with admin consent. Basic auth has been disabled by default tenant-wide since 2022. Some migration tools can still use basic auth if you grant the IMAP scope explicitly in Azure AD and re-enable it temporarily for the migration window.
The migration plan
Lower MX TTL in cPanel DNS
cPanel, Domains, DNS Zone Editor (or Zone Editor on older cPanel). Edit the MX record. Drop TTL to 300 seconds. Save. Wait at least 24 hours so global resolvers honour the shorter TTL.
Reset mailbox passwords if needed
From cPanel, Email Accounts, set or reset each mailbox password. You need these to authenticate from your migration tool against cPanel IMAP. Storage in a password manager during the migration window only; rotate after.
Pre-stage the bulk copy
Start the IMAP-to-IMAP migration from cPanel to Office 365. Users keep working on cPanel. Expect 1 to 2 GB per hour at five concurrent workers per mailbox. cPanel shared IMAP servers throttle around 10 concurrent connections per source IP.
Communicate the cutover
Two days out, send a short note: change is happening, address stays the same, historical mail will be in the new mailbox, here are the client setup steps.
Flip public MX in cPanel DNS
cPanel, Domains, DNS Zone Editor. Replace the existing MX (usually pointing at mail.yourdomain.com which resolves to the cPanel shared server) with the Microsoft host shown in Microsoft 365 admin centre. Format is yourdomain-com.mail.protection.outlook.com at priority 0. Save.
Change Email Routing to Remote
cPanel, Email, Email Routing. Select your domain. Change from "Local Mail Exchanger" or "Automatically Detect Configuration" to "Remote Mail Exchanger". Save.
This is the cPanel-specific gotcha. Without this change, cPanel keeps delivering inbound mail to its own local Maildir even though public MX says Microsoft. Symptom: external senders see mail "delivered" but nothing appears in Office 365.
Run delta sync
Within an hour of MX cutover and Email Routing change, run a final delta pass. Catches mail that arrived at cPanel during the propagation window.
Update SPF and DKIM
SPF in cPanel DNS: replace the existing cPanel include with
include:spf.protection.outlook.com.DKIM in Microsoft 365 Defender portal: enable signing, then add the two CNAME records Microsoft generates to cPanel DNS. Without DKIM, outbound mail starts landing in spam within a week.
Reconfigure clients
Walk users through removing the cPanel mail account in their client and adding the Office 365 account. Outlook autodiscovers from the email address; Apple Mail and mobile prompt for OAuth.
The Email Routing pitfall, in depth
This deserves more than a paragraph because it is the single most common reason cPanel-to-anywhere migrations fail.
cPanel's mail server (Exim) checks two things before deciding what to do with inbound mail:
- The MX record for the domain (queried from public DNS)
- The internal Email Routing setting in cPanel
If MX points externally but Email Routing is still set to "Local Mail Exchanger" or "Automatic", Exim checks for a local Maildir and delivers there. From the external sender's perspective, the mail was accepted by your server. From your perspective, nothing arrived in the new Office 365 mailbox.
The fix is to explicitly set Email Routing to "Remote Mail Exchanger" for the domain. After making this change:
- Send a test message from a Gmail account.
- Wait 30 seconds.
- Check the Office 365 inbox.
- Check the headers. The first Received line should reference
protection.outlook.com.
If headers reference a cPanel hostname or the shared server hostname, Email Routing is still wrong. Re-check the setting.
Tip
Build a small test loop using a personal Gmail and the new Office 365 mailbox. Run the same external-to-internal test after each DNS change (MX flip, Email Routing change, SPF update, DKIM publish). Catches misconfigurations within 30 seconds rather than days.
Throttling, retries, and errors
cPanel shared IMAP servers behave consistently across most hosts. Common errors:
Too many simultaneous connections— drop to five workers per mailbox. Most cPanel hosts throttle at around 10 concurrent IMAP connections per source IP.AUTHENTICATIONFAILED— username must be full email address. Password must be exactly what's in cPanel (case-sensitive). cPanel does not enforce a case-sensitivity rule on usernames but does on passwords.STARTTLS handshake failed— you're using port 143. Switch to 993 implicit SSL.Connection unexpectedly closed— most cPanel hosts kill IMAP sessions after 30 minutes of activity. Use a migration tool that auto-reconnects and resumes.Folder UTF-7 conversion error— uncommon but possible if users created folders with accented characters via Roundcube or Horde. Most cPanel webmail clients use ASCII folder names by default.Message too large for destination— Office 365 caps inbound at 150 MB. cPanel usually caps at 50 MB by default but admins sometimes raise it. Quarantine oversize messages for manual handling via PST.
Where Mailbox Taxi fits
Mailbox Taxi runs as a desktop tool on Windows, Mac, or Linux. It treats cPanel IMAP and Office 365 as two endpoints, auto-reconnects when cPanel drops sessions, and keeps a per-message manifest for resumable delta passes. If you would rather move to Google, the cPanel to Gmail walkthrough is the corresponding writeup. If your specific host is Bluehost, the Bluehost to Office 365 guide has the host-specific landmines called out. For HostGator, the HostGator to Office 365 guide is similar. For a fully generic IMAP source not tied to cPanel at all, the IMAP to Office 365 walkthrough covers the source-agnostic mechanics. And the broader Office 365 migration playbook covers tenant licensing, retention, and the post-migration security baseline.
Validation in the first hour
After MX cutover and Email Routing change:
- Inbound test from external Gmail. Should arrive in Office 365 within 30 seconds.
- Outbound test from Office 365 to external. Headers should show SPF pass and DKIM signature.
- DNS check:
dig MX yourdomainshould return the Microsoft host.dig TXT yourdomainshould show updated SPF. - Folder verification: pick three mailboxes (heavy, light, shared). Compare cPanel folder counts to Office 365. Differences over 1% need a second delta pass.
- Outlook autodiscover test: open Outlook on a fresh user machine. Should auto-configure from just the email address. If not, your autodiscover CNAME in cPanel DNS is missing.
Decommissioning cPanel email
Keep cPanel mailboxes paid and reachable for 30 days post-cutover as a fallback. During that window:
- Verify reliable inbound mail to Office 365
- Catch any forwarder or alias missed
- Confirm all client devices are reconfigured
After 30 days, the cPanel email feature can be effectively abandoned. If the hosting subscription includes a website, that stays; only the email piece is being decommissioned. Delete the Maildir on the cPanel side as final cleanup. For the broader strategy on phased versus single-cutover approaches, see how the migration plan fits within Microsoft's tenant baseline.
Migrate your mailbox the easy way
Join the waitlist for early access and lock in launch pricing.
Related reading
migrate
Migrate cPanel Email to Gmail: Generic Workspace Plan
Move any cPanel-hosted mailbox to Gmail or Google Workspace over IMAP. Generic guide with MX cutover, Email Routing fix, and DKIM steps.
migrate
How to Migrate from IMAP to Office 365
Step-by-step IMAP to Office 365 migration: EAC setup, CSV mapping file, throttling limits, cutover steps and the gotchas that bite admins.
migrate
Migrate Bluehost Email to Office 365: Full IMAP Cutover
Move Bluehost cPanel mailboxes to Office 365 without losing mail or folders. Practical guide for IT admins with MX and DNS cutover steps included.
migrate
Migrate HostGator Email to Office 365: Step-by-Step Plan
Move HostGator cPanel mailboxes to Microsoft 365 over IMAP. Practical admin guide with MX cutover, Email Routing fix, and DKIM steps.
blog
Office 365 Migration: The Definitive Playbook
A complete office 365 migration playbook for IT admins: discovery, batching, throttling, modern auth, cutover vs staged vs hybrid, and validation.
Migrate your mailbox the easy way
Join the waitlist for early access and lock in launch pricing.