Guest mode. You can read posts without signing up. Comments, ratings, job contacts and your own posts open after you sign up and accept the rules. What is Kommit →

Редакция КоммитРедакция портала
commit 81cd78f · 15 days ago

Corporate Mail, Part 6: Moving Between Systems — imapsync, built-in wizards, and MX switching checklist

🌐 Machine-translated from Russian. Show original

In this part:

What we carry#

DataWhat is carried over
Emails and foldersIMAP synchronization (imapsync, cloud wizards)
Calendarsexport/import ICS, CalDAV, Microsoft/Google wizards for "your" systems
Contactsexport/import vCard/CSV, CardDAV,
Shared mailboxes, distribution groups,are created again manually or by scripting
Rules, signatures, delegation,anew, according to the
Pseudonym addressesrenewed after exporting from the old system

Important: IMAP transfers only mail. Calendars and contacts need to be transferred separately — set aside time for this.

Tools#

ToolFrom → Where toFeatures
IMAP migration to Microsoft 365 (Exchange admin center → Migration)any IMAP → Microsoft 365emails only; up to 500,000 items per mailbox; email up to 35 MB; CSV with mailbox list
Hybrid migration ExchangeExchange SE → Microsoft 365migrates everything, including calendars; Outlook does not need to be reconfigured
Google Workspace (Data Migration) Migration WizardMicrosoft 365, Exchange, IMAP, → Workspacemail, and for some sources — calendars and contacts
imapsyncany IMAP → any IMAPa universal, multi-run start, transfers only the missing
Synchronization in Mailcow (Sync jobs)external IMAP → Mailcowbuilt-in IMAPSYNC with configuration from the web panel

imapsync#

The most versatile tool: copies folders and emails from server to server, and only downloads new ones when restarted. Source code is available, the official build is distributed by the author (who also has the FAQ on Gmail, Office 365, and OAuth2). For one-time ports of small volume, the author has an online service.

Example for a single drawer (do not write passwords in the command line — use files with 600 permissions):

imapsync \
  --host1 old-mail.company.kz --user1 ivanov@company.kz --passfile1 /root/secrets/ivanov.old \
  --host2 mail.company.kz     --user2 ivanov@company.kz --passfile2 /root/secrets/ivanov.new \
  --automap --addheader \
  --exclude "^Junk|^Spam"
  • --automap — maps system folders (Sent/Sent, Trash) between servers;
  • --dry — trial run without copying: start with it;
  • for Gmail and Microsoft 365, signing in with a regular password is often prohibited — OAuth2 or an app password is required; see the FAQ on the imapsync website.

After transferring, delete the password files. If you do not know user passwords — use administrator access (master user in Dovecot, delegation in Exchange) instead of resetting passwords for everyone.

Relocation plan#

In 2 weeks#

  1. Inventory: list of drawers, sizes, shared drawers, groups, aliases, transfers. Delete dismissed drawers (or move them to the archive by manager's decision).
  2. All senders from the domain: website, 1C, CRM, scanners, mailings — they will need new SMTP settings and SPF entries.
  3. Lower the TTL of MX and autodiscover records to 300 seconds — at least two days before switching (so the old TTL can expire).
  4. Create mailboxes in the new system, verify the domain (without changing MX).
  5. Pilot: 2–3 IT employees, then 5–10 "regular" users.

In a week#

  1. The first synchronization of all drawers is the longest, taking a day or more. Do it at night and on weekends.
  2. Prepare instructions for employees: how to log in, set up a phone number, where to find old emails, and where to write in case of problems.
  3. Transfer calendars and contacts, create shared mailboxes and groups.

Switching day (preferably Friday evening)#

  1. Resynchronization (delta) — fast, only new.
  2. Switch MX to the new system, update SPF (temporarily — both services), autodiscover, MTA-STS (policy first, then MX).
  3. Check inbound and sending: in, out, from Gmail and Outlook.com, reply to an old email.
  4. Reconfigure 1C, website, scanners, CRM.

After switching#

  1. Another 1–2 synchronizations during the week: some emails via the DNS cache may still arrive on the old server.
  2. Enable DKIM in the new system, remove old include from SPF, check DMARC reports.
  3. Keep the old system in read-only mode for 30–90 days, then make a final backup and turn it off.
  4. Return the TTL to normal values (3600 and above).

Common problems#

The problemCause and solution
Emails arrive alternately in the old and new systemsthe DNS cache; therefore, TTL is lowered in advance and delta synchronization is performed after
Outlook continues to visit the old serverAutodiscover points to the old server or settings are cached in the profile — create a new Outlook profile
Missing emailssource limits (number of connections), large emails (35 MB in M365), excluded folders; compare the number of emails by folders
Duplicate emailssynchronization were run with different tools; use one tool for all passes
Emails from the website or 1C in spamthe new service is not added to SPF/DKIM
Calendars have not migratedIMAP does not migrate them — a separate export

Move checklist#

  • Inventory of mailboxes, groups, aliases, forwards, and all senders from the domain
  • TTL MX and autodiscover reduced to 300 in two days
  • Pilot completed with 5–10 users
  • The first full synchronization is complete, the number of emails across folders matches
  • Calendars, contacts, shared mailboxes, and groups migrated
  • Employee instructions and support contact have been sent out
  • MX, SPF, autodiscover, MTA-STS switched; arrival and dispatch checked externally
  • 1C, website, CRM, scanners reconfigured
  • Delta syncs throughout the week
  • DKIM and DMARC in the new system, unnecessary include removed from SPF
  • Old system — read-only 30–90 days, final backup, shutdown

Series Summary#

PartWhat can you do
1select mail for tasks, budget, and data storage requirements
2set up DNS so that emails reach and your email cannot be spoofed
3to launch Microsoft 365 with AD and MFA sync
4to raise and maintain your server on Mailcow
5protect your email from phishing and hacking, set up an archive and backup
6to move between systems without losing emails

🎉 Series completed. Return to contents.

💬 Which system did you switch from, and what went wrong? Share in the comments — we'll add to the checklist.

Comments 00 участников · 0 гостей🔒 Rate and discuss after signing up

Comments · 0

No comments yet.Sign in to comment, rate and see all comments.