TrekMail TrekMail
Email Migration

Email Migration Tool: Resume Safely When IMAP Jobs Fail

By Alexey Bulygin
Email Migration Tool: Resume Safely When IMAP Jobs Fail

Your email migration tool matters most when the job breaks at 2 a.m. That's the real test. Not the happy-path demo. Not the sales screenshot. If you're moving mail from Gmail, Microsoft 365, or an old cPanel box, failure is normal. The question is simple: does the tool resume cleanly, or does it create duplicates, skip folders, and leave you explaining a mess to users? If you're planning the wider move, start with business email so the migration fits the system you're actually building.

Here's the fast answer. A safe email migration tool needs four things: duplicate detection, retry logic, folder mapping, and item-level logs. Miss any one of them and a mid-run crash turns into a mailbox cleanup project.

You wake up, check the dashboard, and see 68% complete. One mailbox says failed. The user logs in and half their Sent mail is missing. That's not bad luck. That's a tool problem.

That is why good operators care less about a progress bar and more about state tracking. If the tool can't prove what it copied, what it skipped, and where it stopped, you don't have a migration. You have a gamble.

If you want the protocol background, TrekMail's IMAP migration overview explains what IMAP imports move and what they don't. If you're running raw CLI instead of a hosted workflow, this companion guide on imapsync is worth reading before you touch production.

What an Email Migration Tool Must Do When a Run Fails

An email migration tool should resume after network drops, throttling, or bad messages without duplicating mail or skipping folders. The core requirement is idempotency: run the same job again and the destination stays correct. Everything else is secondary.

A lot of tools market speed. Speed is nice. Resume safety is what saves you.

When a job fails, the email migration tool should do all of this by default:

  1. Reconnect without starting from zero.
  2. Skip messages that already exist in the destination.
  3. Log the exact item or folder that failed.
  4. Pause and retry when the source server says slow down.
  5. Keep folder structure intact across different IMAP namespace styles.

If the product can't do those five jobs, don't trust it with a real cutover.

The Failure Modes That Stop Almost Every Large Migration

Most email migration failures are normal IMAP behavior under load. Providers throttle clients, tokens expire, servers reset sockets, and malformed messages blow up parsers. A good email migration tool treats these as expected operating conditions, not rare exceptions.

Let's get specific.

Throttling is first. Gmail, Microsoft 365, and older shared hosting boxes all protect themselves. Hit them too hard and they slow you down or cut you off. A weak email migration tool keeps hammering the server and makes the lockout worse.

Bad items come next. One malformed MIME header or oversize attachment can crash a lazy importer over and over on the same message. If the tool can't quarantine that item and keep moving, your whole run stalls.

Authentication expiry is another common killer. Microsoft has disabled Basic authentication in Exchange Online tenants, and modern auth flows still require token refresh during long jobs. If the migration engine doesn't handle credential renewal cleanly, the run dies in the middle.

Failure modeWhat it usually meansWhat the email migration tool must do
HTTP 429 / 503Provider is throttling or busyBack off, wait, retry, and preserve state
Socket timeoutNetwork path droppedReconnect and verify last copied item
IMAP NOQuota, permission, or mailbox issueLog folder context and continue safely
BAD command / parse errorMalformed item or protocol problemSkip the poison item and record it
Auth expiredToken or app password problemRefresh or fail loudly with a clear reason

Microsoft documents the Basic auth shutdown for Exchange Online in its official guidance on Basic authentication deprecation. On the IMAP side, RFC 3501 defines mailbox UIDs and UIDVALIDITY in the base spec for IMAP4rev1. Those two references explain why old assumptions break in 2025-2026.

Resume Safety Depends on Idempotency, Not Hope

Idempotency means the email migration tool can run again against the same mailbox and still produce one correct copy of each message. Without that, every retry risks duplicates, missed mail, or both. This is the single most important design feature in any migration engine.

This is where cheap tools fall apart.

A naive email migration tool tracks only a last-seen UID and assumes the source mailbox never changes. Real servers don't behave that cleanly. Mailboxes get compacted. Repairs happen. Restores happen. UIDVALIDITY changes. When that happens, the tool must switch from fast UID-based resume to a slower dedupe check such as Message-ID comparison.

That's the difference between a delay and a disaster.

imapsync \
  --host1 imap.oldhost.com --user1 alice@example.com --password1 'source-pass' \
  --host2 imap.trekmail.net --user2 alice@example.com --password2 'dest-pass' \
  --ssl1 --ssl2 \
  --syncinternaldates \
  --useheader 'Message-Id' \
  --skipsize \
  --skipcrossduplicates \
  --errorsmax 50

That kind of delta-safe approach is why operators keep a second pass in the runbook. The first pass gets bulk mail over. The second catches late-arriving items and verifies duplicates aren't piling up.

If you're migrating from Gmail specifically, TrekMail's Gmail migration guide covers the credential side, including the need for an App Password when Google won't accept a plain account password for IMAP access.

Folder Mapping Is Where Silent Data Loss Hides

Folder mapping tells the email migration tool how source mailbox names should land on the destination. Without it, mail may import successfully but into the wrong place. That's a silent failure because the data exists, but the user thinks it vanished.

This bites people all the time.

One server uses dots. Another uses slashes. One labels sent mail as Sent Messages. Another expects Sent Items. A weak email migration tool copies the folder names literally and calls the run complete. The user logs in and sees a root-level junk pile.

These are the mappings that matter most:

^Sent Messages$  -> Sent Items
^Deleted Messages$ -> Trash
^Draft Messages$ -> Drafts
INBOX\.(.+) -> INBOX/$1

That last line is the namespace trap. It converts dot-delimited folder trees from common Dovecot or cPanel layouts into slash-delimited trees that IMAP clients and hosted platforms often expect.

Folder mapping also matters when you're scaling mailbox setup across many domains. This is the same operational problem as provisioning: consistency beats cleanup. That's why bulk create email accounts and multi domain email hosting become relevant once you're migrating more than a handful of users.

Logs Decide Whether You Can Fix the Last 2%

A usable email migration tool must produce item-level logs, not just a green check or a red X. You need to know which message failed, which folder it was in, and why. Otherwise you can't decide whether to rerun, ignore, or escalate.

"Completed with errors" tells you nothing useful. You need a list.

The minimum logging output should include subject, source folder, message date, item size, and failure reason. Better still if it exports CSV. Then you can filter by error type and handle each class of problem the right way.

Here is the operator workflow that actually works:

  1. Run the first migration pass.
  2. Export or review skipped-item logs.
  3. Group failures by cause: auth, timeout, oversize, malformed item, destination quota.
  4. Rerun the job with duplicate skipping enabled.
  5. Manually handle only the true outliers.

That workflow is boring. Good. Boring is what you want during migration.

Before final cutover, verify the destination domain and mailbox setup. TrekMail's Adding a Domain guide covers the DNS side so you don't move mail successfully and then break delivery at the MX step.

Old Way vs New Way: Scripts, Per-Seat SaaS, and TrekMail

The old way is a pile of scripts, per-user migration fees, and manual babysitting. The new way is an email migration tool built into the mail platform, priced at the plan level, with retries and duplicate checks already part of the workflow.

Old Way: run imapsync yourself, manage app passwords, tune retry behavior, map folders manually, review logs by hand, then pay another provider per mailbox after the move.

New Way: use TrekMail's server-side IMAP migration inside the same platform that will host the destination mailboxes. You enter the old IMAP details, choose the TrekMail mailbox, and run the import in the dashboard. The docs show duplicate skipping as a standard option, and the job status is visible as queued, processing, completed, or failed.

That matters because migration shouldn't become a separate profit center. It should be part of onboarding.

TrekMail is built around flat-rate multi-domain email hosting. Plans start at $3.50/month. The product includes custom domains, IMAP mailboxes, catch-all support, BYO SMTP or included SMTP depending on plan, mailbox forwarding, a migration tool, and API access on higher tiers. There's a Nano plan at $0, and paid plans can be tested with a 14-day free trial. The free plan doesn't need a card. The trial does.

For small teams, that means you can move mail without buying a per-user migration add-on first. For agencies, it means the migration process can fit the same control model you already need for mailbox ownership, client onboarding, and recurring margin.

If the economics matter as much as the tooling, compare plans directly at TrekMail pricing.

How to Choose an Email Migration Tool Without Regretting It

Choose an email migration tool based on failure recovery, duplicate handling, folder mapping, and logs. Ignore cosmetic dashboards. If the tool can't survive throttling, poison messages, and retries, it will cost you more time than it saves.

Use this checklist before you commit:

  1. Can the email migration tool skip duplicates on rerun?
  2. Can it keep running after one bad message fails?
  3. Can it map folder names and namespace delimiters?
  4. Can it show item-level errors instead of summary-only status?
  5. Can it handle modern authentication and long-running sessions?
  6. Can it migrate by IMAP without forcing a separate per-user billing model after the move?

If the answer to any of those is no, keep looking.

The best email migration tool isn't the one with the prettiest UI. It's the one that assumes failure will happen and is built to recover without corrupting the mailbox. That's the standard. Anything below it is an outage in waiting.

Share this article

We use cookies for essential functionality. No ads, no ad tracking.

or
or

Reset email sent

If an account exists for this email, we've sent password reset instructions.

By continuing, you agree to TrekMail's Terms and Privacy Policy.