Configuring an Ubuntu Linux server to route outbound emails through Gmail SMTP Relay using Postfix

Here’s another one to file under “For My Own Future Reference,” even though I’m phasing out directly managing clients’ VPS hosting. (What a pain that has become in the 2020s!)

I manage a few web servers, and handling SMTP locally with Postfix is no longer viable thanks to the ridiculous lengths receiving mail servers now have to go to in filtering the nonstop firehose barrage of spam.

Most of the time these are WordPress sites, so I have the client use a plugin like Gravity SMTP to route their mail through their chosen mail hosting provider (typically Microsoft 365 or Google Workspace, more affectionately known as Outlook and Gmail, respectively).

But I have a couple of staging/testing servers where I’ve just given up on having outbound email at all. Except that can still be a pain sometimes, like when clients lose their passwords. (How do people lose their passwords so much? Why haven’t we solved this yet in 2026? And don’t even say “two-factor authentication” or “passkeys.”)

I’ve finally gotten fed up with this situation, and I happen to have a bit of spare time this week to tidy up some of the loose ends that have been annoying me all year, so I decided I needed to find a way to do Gmail SMTP Relay at the OS level on these servers.

Fortunately, I found an excellent tutorial on the matter, so (at the risk of link rot) I won’t bother repeating all of that here. Even though my servers are running Ubuntu 26.04, the tutorial still works.

Except, not quite. After I followed the steps, relay was working perfectly when I sent messages to other domains, but it was failing on emails sent to my own domain. tl;dr The server was still trying to handle those messages locally.

I realized the problem was that the mydestination parameter in the /etc/postfix/main.cf file included my domain. There may be other, better, solutions to this problem, but in my case the simplest thing to do was to edit that line so the only value it contains is localhost. I did that, restarted Postfix, and… it works!

Now that’s really unfortunate… and gross…

But the question on my mind (besides “How is that guy not vomiting?”) is, “Why the hell were they hauling a whale carcass through the middle of a city on a flatbed truck?”

Found here via here.

But to prove that every cloud, or punctured whale carcass, has a silver lining (ugh… sorry… I don’t want that image either), a few clicks onward led me to this wonderment: a photographic compendium of audio cassettes. Now this is a dead technology, laughably inferior to what we almost take for granted today. But from about 1981 when I got my first little red portable tape recorder from Radio Shack, until 1998, when I got my first CD burner, cassettes were it, baby, and I probably went through thousands of blank cassettes from just about every available brand between the ages of 8 and 24. And if you can’t appreciate that, at least I’ve found someone who can.

What other crazy stuff has been happening in professional sports while I wasn’t looking?

It’s true: I pay very little attention to professional sports of any kind. It’s not that I don’t like them, I’m just usually not that interested. I used to be; I collected baseball cards in middle school, and my peak of interest in pro sports conveniently coincided with “my” Minnesota Twins winning the World Series for the first time ever, in 1987.

Since then, it’s been all downhill. I was excited about the Vikings in 1998, only to be let down by Gary Anderson’s only missed field goal of the year, in the NFC Championship game. I watched the Twins’ tiebreaker game against the White Sox this year, only to be let down yet again by a team that has an incredible knack for falling ever-so-slightly short, again and again. Perhaps this “always the bridesmaid” trait common amongst the Minnesota pro teams is what makes it hard for me to be a sports fan. But more likely, I’m just not that interested, and that’s all there is to it. These days the only professional sports I actually get excited about watching are Wimbledon and the Olympics, and their relative infrequency probably contributes to my enthusiasm.

Yet, I am still drawn in by unexpected developments, like the Steelers’ 11-10 win this week. I knew that was a weird score, and I thought it was cool when I learned that out of the over 12,000 NFL games played in the league’s history to date, this was the first ever to end with that score.

But this fact still caught me totally off guard. I was reading kottke.org this morning and he just casually mentioned that the Seattle Supersonics had moved to Oklahoma City. To quote Dave McFly, “When the hell did this happen?” This year, apparently, and I had no clue.

Oh well.

I suppose if you fall for this, you probably have it coming…

Wiimote ripoff

…but still, this pathetic handheld football game, a blatant Wii remote ripoff, is pretty appalling. When I see something like this, I just try to imagine being the kind of person who would mastermind a product like this. But I just can’t. I really cannot understand valuing a quick buck over having any kind of integrity.