IMAP migration is where email projects go sideways. Fast. One bad folder map, one stale DNS cache, one Gmail trap, and you get a weekend outage nobody forgets. If you’re planning a move, read this first, then keep this imapsync operator’s guide nearby. The goal is simple: move mail without duplicates, without silent loss, and without paying extra just because the old host charges you per seat.
That sounds obvious. It isn’t. Email isn’t a zip file. It’s a live system with state, clients, DNS, throttles, and users who keep sending messages while you’re trying to relocate the whole thing. That’s why serious IMAP migration work starts with protocol limits, not vendor promises.
The fix is to separate speed from cutover pressure. Old Way: buy licenses early, rush the move, pray the weekend holds. New Way: stage the destination first, migrate in passes, and use pooled storage so one oversized mailbox doesn’t wreck the budget. TrekMail is built for that model: flat-rate multi-domain hosting, pooled storage, built-in server-side import, and no per-user tax when you need to prepare early.
Why IMAP Migration Breaks in Real Life
IMAP migration fails because it copies message state between servers that do not describe folders, identifiers, and labels the same way. The protocol can move mail, but it was not designed as a perfect bulk replication system. At scale, the gaps show up as duplicates, flattened folders, throttling, and stranded new mail.
The first trap is UID logic. IMAP uses message UIDs plus UIDVALIDITY to tell clients whether a folder is still the same folder. The standard is explicit: if that validity changes, a client has to treat the mailbox as different. That behavior is part of the IMAP spec in RFC 9051. In plain English: if the source mailbox gets rebuilt, renamed, or restored at the wrong time, your IMAP migration can lose its place and start re-copying data.
The second trap is folder namespace mismatch. One host may treat `INBOX.Sent` as a nested folder. Another expects `INBOX/Sent`. Gmail adds another layer by exposing labels as folders over IMAP. If you do no folder discovery before the full run, users open the new mailbox and assume half the company archive vanished.
The third trap is Gmail’s label model. One message can appear under several labels, but a normal IMAP destination stores folders, not labels. That means one logical Gmail message may become multiple stored copies unless you exclude the wrong folders. Google’s own migration help warns that adding All Mail can break or duplicate results depending on the workflow. That’s why a Gmail-heavy IMAP migration needs special handling from the start.
Pre-Flight: Audit the Mess Before You Move It
A safe IMAP migration starts with inventory, not credentials. You need mailbox counts, mailbox sizes, oddball service accounts, legacy forwarding rules, and a short list of high-risk users. If you skip discovery, you are not saving time. You are moving uncertainty to cutover day.
Start with the whales. Every environment has them: founders who never delete anything, finance mailboxes with years of PDFs, support inboxes that turned into archives. These mailboxes decide your timeline. They also expose how ugly per-user pricing gets on the big suites. One 60 GB mailbox can force an expensive license tier on the old platforms. TrekMail’s pooled storage changes that math. The heavy mailbox uses more of the team pool; you don’t buy a special seat just because one person hoards attachments.
Then find dark data. Shared addresses. Scanner accounts. Alert inboxes. Old distribution-list replacements that are really just logins with passwords nobody wants to admit exist. Miss one of those and nothing fails loudly. It just stops routing important mail.
Finally, decide your bad-item tolerance before the first sync. Corrupt MIME parts, broken headers, and over-limit attachments are normal in old mail stores. If your tool is set to fail on the first bad object, your IMAP migration stalls behind one rotten message from 2009. Let the run continue, log the skipped items, and review the report after the pass.
| Discovery item | Why it matters | What to record |
|---|---|---|
| Mailbox size | Sets timeline and staging order | Total GB and item count |
| Whales | Expose quota and throttle risk | Anything over 15-20 GB |
| Service accounts | Break quietly after cutover | Owner, app, auth method |
| Shared folders and labels | Create mapping errors and duplicates | Folder names, separators, Gmail labels |
| Bad items | Can stop the whole job | Count, type, and skip policy |
Big Bang vs Pre-Stage
There are only two real IMAP migration strategies: move everything at cutover, or pre-stage old mail first and finish with a delta pass. Small environments can survive a big bang. Everyone else should pre-stage.
Big bang sounds clean. Change MX on Friday, migrate all weekend, show up Monday and hope the counters line up. It works for tiny teams with tiny mailboxes. It falls apart when the source throttles downloads or your largest mailbox takes longer than the project plan pretended.
Pre-stage is the professional standard. Copy everything older than 30 days while users stay on the old system. Lower DNS TTL before the cutover. Switch MX. Then run a delta sync for recent and newly delivered mail. That turns one giant risk into three manageable jobs.
This is where TrekMail’s pricing model matters. Old Way: you pre-stage on Google Workspace or Microsoft 365 and pay double during the overlap because every destination mailbox needs a seat before users even log in. New Way: you provision the destination early on TrekMail, run the built-in import weeks ahead, and you’re not punished with a per-user bill just for being careful. Paid plans start at $3.50/month, and the 14-day paid trial exists for testing the workflow. The Nano plan is separate, always free, and doesn’t require a card.
| Strategy | Best for | Main risk | Verdict |
|---|---|---|---|
| Big bang | Under 10 users, low data volume | Weekend overrun | Acceptable only for small jobs |
| Pre-stage | Teams, SMBs, agencies, MSPs | Needs planning discipline | Use this by default |
The Safe IMAP Migration Runbook
A repeatable IMAP migration runbook has five parts: create the destination, test folder structure, copy old mail, cut over DNS, and run a delta pass. Each step reduces blast radius before you move to the next one.
- Create destination domains and mailboxes first. TrekMail’s docs for adding a domain and IMAP settings give you the exact DNS and connection values. Don’t improvise the MX target. TrekMail’s live docs show `mail.trekmail.net` with priority `10`.
- Run a skeleton pass. Build folders before copying bulk data. This is where dot-vs-slash problems show up while the cost of fixing them is still low.
- Run the bulk pass for old mail. For Gmail sources, exclude `[Gmail]/All Mail` and Trash from any normal IMAP migration plan unless you have a very specific mapping reason.
- Lower MX TTL to 300 seconds at least 24 hours before the change. If you skip this waiting period, caches keep old values and mail splits between old and new systems.
- Change MX, verify propagation, and run a delta pass with duplicate skipping turned on. TrekMail’s import workflow supports duplicate skipping for repeated runs, which is exactly what you want after pre-staging.
Use commands, not guesses, when you verify DNS:
dig MX example.com +short
dig TXT example.com +short
dig TXT _dmarc.example.com +shortIf you’re doing a manual run with imapsync, keep it boring. Boring wins.
imapsync \
--host1 old.mailhost.tld --user1 user@example.com --password1 'SOURCE_PASS' \
--host2 imap.trekmail.net --user2 user@example.com --password2 'DEST_PASS' \
--ssl1 --ssl2 \
--exclude '\[Gmail\]/All Mail|\[Gmail\]/Trash' \
--syncinternaldates \
--useheader 'Message-Id' \
--skipsizeFor DNS cutover, the record should look like this:
example.com. 300 IN MX 10 mail.trekmail.net.Gmail, Microsoft 365, and Other Special Cases
Not every IMAP migration source behaves the same. Gmail brings label duplication and bandwidth limits. Microsoft 365 brings auth complexity because Basic Auth is gone in Exchange Online. Older on-prem Exchange can fail due to TLS mismatch. Treat each source type as its own risk profile.
Gmail is the most common troublemaker. Google publishes a daily IMAP download limit of 2500 MB per account for Workspace environments in its Gmail bandwidth guidance. Hit that wall and your migration drags or fails. Don’t schedule a 20 GB Gmail account as if it will copy in one smooth burst. Pace it. Stage it. Expect it to take days, not hours.
Microsoft 365 is a different headache. The old “just use username and password over IMAP” habit is dead for Exchange Online. Modern auth and OAuth are the baseline now. If your migration tool still assumes Basic Auth, your IMAP migration will die before the first mailbox even starts. That’s one reason operators still keep fallback playbooks and why some shops prefer tools that handle auth negotiation for them.
Conceptual example: a 12 GB Gmail mailbox with Inbox, Project, Important, and All Mail visible over IMAP does not behave like a neat 12 GB folder tree. It behaves like a label graph pretending to be folders. That difference is where duplicate storage comes from.
If your project includes onboarding many users after the move, line that up with mailbox creation and access control before cutover. TrekMail already has published runbooks for bulk create email accounts and customer email management. Use them. Migration chaos usually spreads through provisioning mistakes, not the copy engine alone.
Verification: Count Items, Not Gigabytes
The only IMAP migration verification metric that holds up across platforms is item count by folder and by mailbox. Total gigabytes are inconsistent because providers calculate MIME overhead, compression, and deduplication differently. Size is useful for planning. It is weak proof of success.
After each pass, compare source and destination counts. If the source says 14,200 items and the destination says 14,195, that is normal if your skipped-item report shows five broken messages. If the destination says 10,000, stop. Do not tell users the move is done because the storage graph looks close enough.
Watch the old server for at least 48 hours after MX cutover. Hardcoded devices and forgotten apps may still dump mail into the old mailbox. Printers do this. CRMs do this. Legacy contact forms do this. That’s how zombie mailboxes happen. The fix is usually one last delta pass after you find the stragglers.
If the move is part of a larger stack cleanup, this is also when readers should think about the next operating model. Not just where mail lives, but how many domains, mailboxes, and clients they need to control. TrekMail’s architecture is a better fit for that than the suite vendors if your real problem is operational sprawl. That’s the same theme behind multi domain email hosting and the broader cost logic in business email.
Conclusion: Slow Down the Risk, Not the Project
IMAP migration rewards patience, sequencing, and verification. You do not win by going faster than the source can tolerate. You win by reducing unknowns before cutover, excluding the folders that cause duplication, respecting DNS timing, and checking item counts instead of pretty dashboards.
If you want a safer destination for IMAP migration, TrekMail gives you the parts that actually matter: multi-domain control, pooled storage, server-side import, standard IMAP access, and pricing that doesn’t punish overlap planning. That lets you migrate old mail early, run your delta pass cleanly, and stop treating email moves like a casino weekend.
Start with the docs, stage the destination, and then move on your timetable. If you need a flat-rate destination that won’t charge you a seat tax while you prepare, TrekMail is at trekmail.net.