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:
- paying for Google Workspace
- paying for Microsoft 365 Business Basic
- CloudFlare Email Routing + consumer email
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
My migration strategy contains the following TODO’s:
- Setup outlook.com
- Copy emails from Gmail to outlook.com
- Migrating Contacts & Calendar
- Changing service account senders (printer, nas) to sendgrid.com
- 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 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
- Download from Google Takeout
- Convert MBOX to PST, likely using a shady commercial tool
- 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 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
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 \ --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 seperate mailbox.
If using a mode modern version of imapsync, you can use
Now wait, the sync will take days (mostly due to the Gmail limits).