Migrating my email from Qmail and Gmail to Fastmail
As best as I can tell, I've been self-hosting my email, with Qmail (on NetBSD) since 2000 or 2001. Then last week (2026-01-02) I switched my MX over to Fastmail.
25 years. Damn.
The story begins with a geek who liked to learn stuff. It ends with a geek who's tired of being a sysadmin for a service that's harder and harder to keep working, and who really wanted to get his life (more) out of Google's hands.
Many yaks were shaved in this last step; if you currently self-host email with Qmail, and use Qmail's extension addresses (e.g. user-extension@domain.com), and you want to switch to Fastmail, you should probably read this bit.
(Note that Qmail isn't usually capitalized but I'm doing that here to distinguish it from Gmail.)
Spelunking my old-timer credentials
I'll try to keep it brief 😜
My old domain was truist.com (but now a bank has it) and the oldest evidence of it on the Wayback Machine is from March 2001.
Even that very-oldest page has a (non-functioning) link to mail.truist.com, so I was hosting - or at least trying to host - webmail at that point.
That page also has a "Feedback" link with a truist.com email address, so clearly I had email working.
A later version of that page (February 2002) has the first working link to my about the site page, where I say I started truist.com in the late summer of 2000, on a machine running at my house. (Apologies for the bad apostrophes on that page! 🫠)
Reading that page closely suggests that I had inbound mail working quickly, and then the website, and then webmail... so I think it's fair to say I was "hosting email" in 2000, but probably webmail wasn't up until 2001 or 2002.
In 2000 I was probably still using my college email address as my primary, but I'm sure that before I graduated (in 2001) I had switched over to using my truist.com email as my primary personal email address. (And it shows up on my resume from 2002.) So "my email address" has been self-hosted since 2001, at least.
I also found a local backup of an old computer with a 74-page MS Word doc (what?!?) - dated October 2004 - with all my install notes for setting up the replacement for that first computer, still hosted at home. (It had a Pentium processor, 64MB RAM (maxed out!), and a 29GB hard drive!) In it I detail setting up Qmail (page 40) and courier-imap (page 47) and IMP (webmail; page 73). So clearly by that point this was just "standard practice" for me.
By that time I was also probably hosting my wife's email, too.
Google appears on the scene
Then just a month later I created my first Gmail account. I still have my welcome email from them, dated November 9, 2004. At that point Gmail was still invite-only. (Crazy, right?!).
That very same day, I set up a forward from my mail server into Gmail, and configured Gmail to send using my truist.com address, and it looks like I probably switched over to using Gmail as my webmail front-end from that point on.
Then in 2006 I wrote up exactly how I had it set up, with email just forwarded to Gmail, and I even had a secondary MX!
I think at that point my primary email UI was probably Thunderbird on a desktop/laptop, over IMAP. (This was pre-iPhone, remember?) So Gmail really was just a fallback way to get to my email.
Then in 2009 apparently the two-MX setup saved my ass - and from the details in that post, at some point my friend had started hosting my primary MX, not me. So probably sometime around then was when I switched to just using Gmail as my primary UI for email, and that has been the situation ever since: even though I hosted the mail server, I used Gmail as my email UI.
And then life gave me kids (with email addresses!) and email became much less of a "fun project" and much more of "yaks to shave at the worst possible moment".
But mostly it was fine; I don't think I've ever had a major email outage.
(A few panicked hours, here and there, though!)
Modern email infrastructure
Then in 2017 I was finally ready to move my server out of my house and into a VPS... and realized that it was going to complicate my email setup massively.
To quote from my never-officially-published, but still internet-discoverable, blog about this:
since I was serving from home, I found that I got much more-reliable spam results from Gmail when I configured my mail server to forward all email through my ISP's mail service – so it had been configured that way since nearly the beginning. This was especially true for my "simple forwarding" email lists, so e.g. I could have "list@rainskit.com" and it would just be configured via dot-qmail to forward any email received to a bunch of other (external) email addresses. Emails to those lists were far more likely to get classified as spam, until I started passing them through my ISP.
So somewhere along the way of migrating email from my home server to my new VPS, I remembered that I was passing everything through my ISP. And I realized that I was about to be without an ISP email server to pass them through. So I was going to lose whatever benefits that ISP was giving me. So I started researching modern email server configuration... and I had a lot to learn!
That blog post is actually a treasure trove of the history of my server and an overview of the pain of hosting a modern email server. But the short version is: SPF, SRS, DKIM, DMARC, oh my! Oh, and ezmlm!
I ended up learning about all of those and setting up all except DKIM, largely because Qmail didn't support it. (My friend, who is the primary maintainer of Qmail these days, eventually added support.) And that worked. But it was fragile.
And then, later (scroll to the bottom of the post!) I avoided some of the headaches by switching my setup to have Gmail fetch from my server, via POP, rather than me just forwarding directly to them. That was actually more reliable (in terms of spam classification) but it had a big downside: Gmail only checked every minute or two. So email took a while to show up.
Which is especially frustrating for those "magic link" login workflows 😡
But I learned to live with it, and I've been living with it for 15+ years.
Moving away from Google
I haven't had a Facebook (et. al) account since 2010. I moved off Twitter when it went evil. At some point I went from a "Google fan" to a "anti-Google" - but I was in so deep with them, it seemed hopeless to get away.
But then along came Kagi for search, and I switched and I've been thrilled with it.
So I looked again at switching email providers, and couldn't find one I thought would be good. Gmail's features are just SO good, and I have many shared Google calendars, so it seemed like a big loss to switch to any other webmail provider, especially a smaller (paid) one that probably didn't have some of the nicest features.
But then something happened in mid-2024 - I don't remember what - that made me finally get serious about switching. So I did a bunch of research and settled on Fastmail as the answer, and started the process of switching.
And Fastmail made it really easy! They could take over as the MX, and they could import all my email (and contacts, and calendar) from Google, and they had all the main features I wanted! (Not some of the nicest features... but that's OK - they also don't spy on everything I do and everything I buy!)
But then the big yak appeared: I had about 2,000 qmail extension addresses, and Fastmail has a hard limit of 600. 🙀
Migrating qmail extension addresses to Fastmail
Fastmail does have "plus" addressing - e.g. user+extension@domain.com - and it does exactly what Qmail's extension addresses do... but with a + instead of a -.
And through multiple email conversations with their support people (who are fantastic!) it became clear that they can't just treat - addresses as + addresses.
The next closest thing is to configure each - address as a Fastmail alias - but they have a hard-coded account-wide limit of 600 aliases, and I had about 2000!
Plus the rest of my family, between them, had about 700 more!
So even though I'd set up Fastmail, and imported my (and my family's) Gmail email into it... I got stuck. And it stayed that way for 18 months - we were still using Gmail, but with email copied over to Fastmail, too.
And then - with 3 days' notice - I learned that Google was dropping support for fetching email via POP. So suddenly this problem was urgent!
I contacted Fastmail support again, hoping there was some new solution, but there wasn't.
But I found one, on my own! It's pretty ugly, though. In essence it's this:
-
Set up a catch-all alias for the domain, sending all un-matched email to me.
-
For each of the other users on my domain, set up a rule, in my account, matching on
otheruser-*@domain.com, that sends a copy of the email tootheruser+catchall@domain.com, and deletes the email from my inbox. -
Set up a rule for myself, matching on
myuser*@domain.comthat just says to stop processing further rules. -
For each of the other users on my domain, set up a rule, in my account, matching on
otheruser-*@domain.com(the same as before), sending the email to the trash.
That careful set of rules means that any email sent to otheruser-whatever@domain.com, if that specific address isn't already configured as an alias, will:
-
First go to my account, because of the catch-all alias
-
Then get forwarded to the other user
-
Then, if I'm not also a direct addressee of that email...
-
...be deleted from my account
Yes, that's gross. But it works!
I've found one edge case so far where it has a problem: if a single email is sent to both otheruser-whatever@domain.com and myuser-whatever@domain.com, and if otheruser-whatever@domain.com is configured as an alias, then otheruser will get two copies of the email.
I (and they) can live with that.
I also added one nice-to-have email rule for each my other users, within their accounts: any email with X-Resolved-To that is exactly otheruser+catchall@domain.com gets a special label to make it clear that this email was delivered via my account.
So then they can configure an alias, or contact the sender and change the address to a + address, to fix that.
But I think mostly they just won't bother.
The whole pile of yaks
I said Fastmail made it easy to migrate from Gmail, and that's true, they did. But still, migrating 4 users and Qmail extension addresses and 20 years of history and many shared calendars and all our contacts and all our devices and all our apps... that was full of yaks.
To help any intrepid explorers who come after me, here's roughly the steps I went through:
-
Sign up for Fastmail and configure it to import email, contacts, and calendars from Google (for all my users).
-
Deal with all the Qmail extension addresses, as described above.
-
Migrate the various routing rules and block rules, for each user. This included server-side
.qmailfiles, Qmail global alias rules, some oddball things I had running fromcron, and rules and blocklists configured in Gmail. -
Turn on the "labels" feature in Fastmail, for each user.
-
Realize that I wasn't going to be able to maintain any of my ezmlm lists via Fastmail... and just accept that loss.
-
Export all the calendars from Google Calendar (to files) and import them into Fastmail (to new calendars). Then disconnect the Google calendars from Fastmail, and set up sharing between the new Fastmail calendars.
-
Set up my domain in Fastmail and switch the MX record in DNS! (And test it!)
-
Have Google stop trying fetching mail from my server, for each user.
-
Delete my MX Toolbox email monitor for my server.
-
Watch my server mail logs for a while to see if anything was still contacting it. Realize that Google was, because it was still configured to send email from my domain. Go in and delete those settings, for each user. Then the logs were quiet.
-
Delete the email-only users on the my server.
1. Panic after I accidentally deleted my primary (non-email) user! 🙀
2. Spin up a backup copy of my VM (you have backups, right?) and recreate the user from the backup.
-
Stop the Qmail services on the server.
1. Realize that I still need a mailer for outbound mail from the server, so figure out how to reconfigure Qmail to just do outbound mail. This had a few of its own yaks.
-
Try to explain to my users what all has happened and what this means for them.
1. This was challenging!
-
Have each user, including myself, set up their personal accounts and devices:
1. Have Fastmail stop synchronizing email from Google.
2. Archive all the email that was in my Fastmail inbox, then manually search and un-archive the ones I still wanted to be there.
3. Archive everything in my Gmail inbox, so I can see if anything is sent directly to my Gmail address.
4. Set up an auto-responder in Gmail telling people that I don't use the address.
5. Switch my phone accounts and phone apps and phone contacts around to be the way I want them to be.
7. Start the long process of migrating
-addresses to+addresses.
And with that, I am much more free of Google! (But not entirely... I still haven't left YouTube.)
- ← Previous
Teaching kids about money