October 12, 2021

How NOT to Migrate an Email Domain

The new IntroMaker.com hero section.

How NOT to Migrate an Email Domain

I did the thing! I moved IntroCave.com over to IntroMaker.com. It's still a bit of a work in progress (some thoughts here), but I decided to break this out as a separate post.

There's a lot of information on the web about the actual mechanics of migrating to a new domain (301 redirects, search console updates, web server settings, etc), but unfortunately I didn't find great resources on migrating my email over to the new domain. I've been using Mailgun for years, so I just set up a new domain and updated all my configs to send from the new domain. I was sending ~1,000 emails a day on normal days and a monthly newsletter of around 30,000.

Throwing the switch worked great for the daily volume.

It was around that point I decided I should probably send an account notice about the domain switch. I'm a bit fuzzy on whether you actually have to send out those emails or not, but everyone does it and it seems like a best practice to send out notices for major account changes.

I thought about sending the notice from the old IntroCave domain, but it would've been quite a bit more work to support two different sending domains that are both sending messages concurrently. I chose the path of least resistance and scheduled a blast to ramp up and go out to 300k+ users using a bit of quickly-thrown-together code from my newsletter system.

It worked great the first couple of days, but a little past 100k emails Mailgun deactivated my entire domain.

The reason: bounces.

I usually have a pretty low bounce rate – if you don't put in a real email, you can't get your videos. Still, with over 300k signups there are a bunch of bogus and deactivated emails in there. My normal mail system handles this pretty gracefully – after a hard bounce or a spam complaint, you go into a bucket of users who will never get another newsletter or automated email again.

Mailgun is also pretty smart and won't let you email users that have bounced previously.

Rather, what I should say is: Mailgun is pretty smart and won't let you email users that have bounced previously on that domain.

Brand spanking new intromaker.com didn't have any bounces.

Old stinky introcave.com had about 17,000 bounces.

I forgot to migrate the bounce list from the old domain to the new domain (and, less important numbers-wise but still important: the spam list).

To make matters worse, my newsletter algorithm prioritizes sending emails to more recently active users first. This includes on-site activity as well as a prior history of opening emails. I purge that data after about 6 months (less data is a good thing these days). After an initial burst of "good" emails, I started hitting around a 5% bounce rate and Mailgun gave me the ban hammer.

I was at a friend's house watching football (Go Dawgs!), so I couldn't do anything about it for a good long while.

I paused my internal ToS/newsletter code and filed a ticket with Mailgun to turn back on the regular emails (everything was shut down, not just that one campaign). They took ages to get back to me and replied with a boilerplate list of 10 questions I had to answer before getting reinstated (some of which I'd sent in my initial ticket and some of which they could easily pull from my account).

I gave what I thought was a pretty full response: (paraphrasing) the offending emails are shut down, I'll work on purging/cleaning that list, turn me back on so normal signup emails work again.

Their response: we will not reinstate your account until you confirm that you've cleaned the list.

Conveniently, they offer a list validation service. How much would they charge to clean my list? One thousand three hundred fifty-fucking-eight dollars.


That's the point they lost me as a customer.

After seething about it for half an hour before responding, I responded told them I wasn't doing it. They could either reinstate me or I'd just migrate to another service.

I've written a LOT of code on Mailgun over the years, and that accumulated code has held me back from trying other services. It took a lot of trial and error (oh, you can't send out a mailing list blast to 50-100k users at one time?) to get pretty okay deliverability, but the current system is stable and pretty easy to operate.

I've heard good things about Postmark's delivery metrics, so this was finally the thing to get me moving. It would be a 2-company race: would Mailgun reinstate me or would I finish the Postmark integration first?

It ended up being a tie.

It took me about a day to move all my emails over to Postmark. It took a day of support tickets with multi-hour delays between responses to finally get my account switched back on. For a few hours, anyway.

The same automated system that booted me out the first time kicked in after around 100 normal emails because I was still over 5% bounce rate in the previous 24-hour span. I had to file another ticket and wait several more hours before it came back online for good the next day.

That gave me a little wiggle room, so I knocked off a few more email TODOS:

  • updated logos and redesigned all my emails
  • added an explicit bounce flag to my user database
  • wrote a script to import all the historical bounces from both domains on Mailgun
  • wired up all of Postmark's webhooks

I threw the switch a few days ago, and I'm getting ready to send out my first newsletter through Postmark. Theoretically, I'm set up to run both services right now. I stopped the ToS email with around 70k more users to send, so I'm thinking about sending that out as one final blast through Mailgun.

To be fair to Mailgun, I think their service is pretty good! I think their support is pretty awful, though, and that opinion wasn't formed in one weekend. I asked a ton of questions when struggling with email deliverability a few years back and never got great answers. The place I kind of left it with them was: "Email is hard. This is the least bad option."

I don't know yet whether Postmark will be any better, but I like the product so far and they seem to be a lot more customer-focused. Fingers crossed!

Addendum: this generated some good questions on Hacker News (thread link) and a nice email from someone at Mailgun. Hopefully the title of the post made it clear that this was my screw-up to begin with, and the point of the post is to save someone else from making the same mistake. I may or may not use Mailgun in the future, but the downtime-with-no-indication-of-when-they'd-reenable-me was the kick in the pants I needed to try Postmark. If Postmark doesn't work out, I'll probably try SES or switch back to Mailgun. Literally all my trouble with Mailgun over the years has been me trying to put a square peg in a round hole. I've had no problems with them for transactional email, and tons of problems sending out campaign blasts efficiently… to 50k+ users. I didn't really have any problems until my list got huge, and having put a shitload of research into this over the years I'm not sure any of the other services handle large infrequent email blasts any better.