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

After considering several options:

I decided to settle on CloudFlare Email Routing + Microsoft’s outlook.com, 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 outlook.com
  2. Copy emails from Gmail to outlook.com
  3. Migrating Contacts & Calendar
  4. Changing service account senders (printer, nas) to sendgrid.com
  5. Setup CloudFlare Email Routing

Setup outlook.com

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

Copy emails from Gmail to outlook.com

After evaluating multiple options:

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

    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.

imapsync

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

1
nix-shell -p imapsync

Imapsync and Two Factor Authentication

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

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

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

The imapsync, FAQs and following blogs were very useful:

Copying emails using imapsync

1
2
3
4
5
6
7
8
9
10
11
12
13
14
imapsync \
    --host1 imap.gmail.com \
    --ssl1 \
    --user1 $GMAIL_EMAIL \
    --passfile1 gmail.pw \
    --automap \
    --useheader X-Gmail-Received \
    --useheader Message-Id \
    --exclude \[Gmail\]$ \
    --folderlast [Gmail]/All Mail \
    --user2 OUTLOOK_EMAIL \
    --passfile2 outlook.pw \
    --host2 outlook.office365.com \
    --ssl2

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).