Since Gsuite (previously Google Apps) is no longer free, and my personal email ( was hosted there I’m looking for alternatives.

After considering several options:

I decided to settle on CloudFlare Email Routing + Microsoft’s, part of my Microsoft 365 Family subscription. This includes 100gb of email storage (currently using ~12gb in Gmail). The goal is to maintain both my custom domain(s) as well as my email archive

Migration Strategy

My migration strategy contains the following TODO’s:

  1. Setup
  2. Copy emails from Gmail to
  3. Migrating Contacts & Calendar
  4. Changing service account senders (printer, nas) to
  5. Setup CloudFlare Email Routing


Since I was already using my personal email on my custom domain as my Microsoft Live ID I already had access to; although by default it had a randomly generated email address, luckily in you can add aliases.

Copy emails from Gmail to

After evaluating multiple options:

  • Using Google Takeout to download MBox files and then ingesting them into

    Unfortunately this would involve multiple steps

    1. Download from Google Takeout
    2. Convert MBOX to PST, likely using a shady commercial tool
    3. Opening the converted in Outlook Desktop and uploading

    This would be a lengthy process.

  • Using a Third Party SaaS sync service

    Unfortunately I could not find any, and some concerns about privacy.

  • Syncing between Gmail and Outlook IMAP accounts

I decided on the latter and came across imapsync, which luckily has a Nix package (although outdated). I wanted to use a cli approach over just using a regular mail client, due to the process taking multiple days.


Using Nixos gaining a temporary shell with everything you need is as simple as:

nix-shell -p imapsync

Imapsync and Two Factor Authentication

I’m using 2fa with my accounts, luckily both Gmail and have support for app passwords;

I put the passwords in 2 files (which I’ll delete when I’m done), in and in

On another note, for Outlook, use the email address to authenticate, not the one from your custom domain.

The imapsync, FAQs and following blogs were very useful:

Copying emails using imapsync

imapsync \
    --host1 \
    --ssl1 \
    --user1 $GMAIL_EMAIL \
    --passfile1 \
    --automap \
    --useheader X-Gmail-Received \
    --useheader Message-Id \
    --exclude \[Gmail\]$ \
    --folderlast [Gmail]/All Mail \
    --user2 OUTLOOK_EMAIL \
    --passfile2 \
    --host2 \

Optionally you can add --subfolder2 gmail to keep it in a separate mailbox.

Imapsync in progress

If using a mode modern version of imapsync, you can use --gmail1.

Now wait, the sync will take days (mostly due to the Gmail limits).