Today's Deep-Dive: Postfix
Ep. 378

Today's Deep-Dive: Postfix

Episode description

In this episode, we dive into Postfix, the mail server software quietly powering email delivery across the internet, and unpack why its design was such a major leap forward from the fragile, insecure systems that came before it. Starting with the late-1990s problems of Sendmail, we explore how Postfix creator Wietse Venema rethought mail infrastructure around speed, easier administration, and above all, security through modular design and defense in depth.

From there, we trace how Postfix has continued to evolve for the modern era, adapting to containers, cloud-native logging, JSON-based automation, modern databases, stronger encryption, and global email standards like SMTPUTF8. Along the way, the episode highlights the software’s obsession with reliability, from blocking botnets and trickle attacks to its near-paranoid insistence on true disk writes so messages are never lost. More than just a technical story, this is a look at the invisible infrastructure behind every sent email and a reminder that some of the internet’s most important software is built not to move fast and break things, but to endure.

Gain digital sovereignty now and save costs

Let’s have a look at your digital challenges together. What tools are you currently using? Are your processes optimal? How is the state of backups and security updates?

Digital Souvereignty is easily achived with Open Source software (which usually cost way less, too). Our division Safeserver offers hosting, operation and maintenance for countless Free and Open Source tools.

Try it now!

Download transcript (.srt)
0:00

All programmers are optimists.

0:02

It's quite the opening line.

0:04

Sounds a bit like a fortune cookie,

0:06

but I'm guessing there's more to it.

0:07

There is.

0:08

It's from Frederick P. Brooks, Jr.,

0:10

from the Mythical Man Month.

0:11

And it's the very first thing you

0:13

see on the home page for the software

0:15

we're talking about today.

0:16

And I just love that energy.

0:17

Because when you think about the sheer chaos of the internet,

0:21

the spam, the bots, the crashes, you

0:24

have to be an optimist to build something

0:26

that handles our communication.

0:28

Oh, absolutely.

0:30

You'd have to believe it's possible to bring

0:32

some order to all that chaos.

0:34

A pessimist would just unplug the server and, I don't know,

0:37

go live in a cave.

0:38

Exactly.

0:39

So today we're doing something a little different.

0:41

We're going under the hood of something

0:42

we all use constantly, every single day,

0:44

without a second thought.

0:46

We're talking about Postfix.

0:47

The engine that actually runs our email.

0:49

Right.

0:50

Most people just click Send and assume

0:51

some kind of magic happens.

0:53

But there's this piece of software catching

0:55

that message, figuring out where it goes,

0:57

fighting off the bad guys, and making sure it

0:59

doesn't just disappear.

1:01

And we're going to demystify it.

1:02

That is the mission.

1:03

We're going to explain this so that even a total beginner can

1:06

get it.

1:06

We want to make this technical server software understandable,

1:10

even if you're not a sysadmin.

1:12

Sounds good.

1:12

But before we dive into how your email actually

1:14

travels the world, we have to give a quick shout out

1:17

to the folks who make this deep dive possible.

1:19

That's right.

1:19

Safe server.

1:20

Kimmert sich das Hosting dieser Software und unterstützt dich bei deiner digitalen

1:26

Transformation.

1:27

Mehr Infos unter www.safeserver.dady.

1:31

Excellent.

1:31

So let's go back to that quote.

1:33

All programmers are optimists.

1:35

Who is the optimist behind Postfix?

1:38

So this story starts with a guy named Vizi Venema.

1:40

And we're going back a bit here to the late 90s

1:43

when he was at IBM Research.

1:44

Right.

1:45

And to really get why what Vizi built was so revolutionary,

1:48

you have to understand what he was looking at back then.

1:50

In the 90s, if you ran a mail server,

1:53

you were almost definitely using a program called SendMail.

1:55

And I'm guessing SendMail wasn't exactly perfect.

1:58

That is a very polite way to put it.

2:00

SendMail was the standard, sure, but it was just notoriously

2:04

difficult to configure.

2:05

Its config file looked like someone had just smashed

2:08

their face on the keyboard.

2:09

Oh, wow.

2:10

But even worse than that, it was a security nightmare.

2:14

How so?

2:15

Well, it was a monolithic program.

2:17

That means it was one giant piece of code

2:19

that did everything.

2:21

And because it did everything, it ran with root privileges.

2:25

OK, root.

2:25

For beginners listening, that's basically

2:27

god mode on a computer, right?

2:29

You can do anything.

2:30

Exactly.

2:30

The keys to the entire kingdom.

2:32

So if a hacker found just one bug in SendMail.

2:35

He didn't just break the mail server.

2:37

They own the entire machine.

2:38

That's terrifying.

2:39

So Waitsy Venema wanted to build a better alternative.

2:42

He wanted to build the anti-SendMail.

2:44

And he really stuck with it.

2:46

I mean, even after he went to Google,

2:47

he was there for eight years, he kept maintaining Postfix.

2:50

This wasn't just some corporate project for him.

2:52

It was a passion project.

2:54

That's rare.

2:54

So let's talk about the design.

2:56

You said SendMail was a monolith.

2:57

How is Postfix different?

2:59

Waitsy built it on three pillars.

3:01

Fast, easy to administer, and secure.

3:04

And the secure part is where the genius comes in.

3:07

Instead of one giant program, Postfix

3:10

is a collection of many small specialized programs.

3:13

Like a team of specialists instead of one overwork manager

3:16

trying to do it all.

3:17

Precisely.

3:17

You have one little program that just listens

3:19

for network connections.

3:21

A different one puts mail in the queue.

3:23

Another one writes it to the desk.

3:25

And the key is, most of these little programs

3:27

do not run with root privileges.

3:29

So if a hacker breaks into the program listening

3:32

for connections?

3:33

They're stuck.

3:33

They're in a little box.

3:34

They can't get to the rest of the system.

3:36

It's a defense in depth strategy.

3:38

That makes so much sense.

3:39

But here's the part I found really clever.

3:41

What I'm calling the Trojan horse strategy.

3:44

Wheatsey knew that sysadmins are creatures of habit.

3:47

They'd spent years learning those cryptic send mail commands.

3:50

Right.

3:50

You can't just throw all that knowledge out.

3:52

So if he made Postfix totally alien, nobody would switch.

3:55

Exactly.

3:56

So he made the outside, the commands you type,

3:59

have a very send mail-ish flavor.

4:02

If you knew send mail, you could basically

4:03

start using Postfix right away.

4:05

But the inside, the engine, was completely different.

4:08

Totally different.

4:09

It's like he swapped out the engine of a classic car

4:11

for a modern electric one, but kept the dashboard exactly

4:14

the same so the driver wouldn't freak out.

4:16

That's a great analogy.

4:17

And because of that philosophy, it just spread everywhere.

4:20

I saw the list of systems it runs on.

4:22

It's a roll call of heavy duty computing.

4:24

AIX, BSD, HVUX, Linux, Mac OS, you name it.

4:29

If it's a UNIX-like system, Postfix

4:32

is probably at home there.

4:33

So for anyone listening, think of it

4:35

like the universal translator of mail servers.

4:38

It just works pretty much anywhere.

4:40

It does, but that brings up a really important question.

4:42

Postfix has been around a while.

4:43

And in tech, software usually ages like milk, not wine.

4:47

So how does it stay relevant in the age of the cloud

4:50

and modern apps?

4:52

That is the big question.

4:53

We're in the era of Docker and Kubernetes.

4:56

You'd think a legacy mail server would be completely obsolete.

4:59

But it's not.

5:01

And that's because Postfix has evolved.

5:03

If you look at the 3.x versions, like 3.3 and 3.4,

5:07

you see this huge push toward containerization.

5:10

OK, let's unpack containerization,

5:11

because that's a buzzword you hear all the time.

5:14

Think of it like this.

5:15

Old software, you installed it directly on the computer.

5:18

It was messy.

5:19

Today, we package software up in a sealed shipping container

5:22

with all its dependencies.

5:24

Like a pre-packed lunchbox for an application.

5:26

Exactly.

5:27

And you can ship that container anywhere.

5:30

But software inside that box needs to act differently.

5:33

For example, it often needs to be the boss process, what

5:36

we call PID1.

5:37

Postfix added support for that.

5:39

And the logging thing.

5:40

I found this fascinating.

5:41

Old software wrote its logs, its diary to a text

5:44

file on the hard drive.

5:45

But in the cloud, that's a disaster.

5:48

It is.

5:49

Because containers can just vanish.

5:51

If it crashes, the log file inside it is gone forever.

5:53

You've lost all the evidence.

5:55

So where should the logs go?

5:56

Modern systems want the app to just shout its logs

5:59

out the front door to sit out.

6:01

The cloud platform catches them and stores them

6:03

safely somewhere else.

6:04

And Postfix learned to shout.

6:05

In version 3.4, yes.

6:08

It learned to shout.

6:09

And that sounds like a tiny detail, but it's a huge deal.

6:12

It means Postfix is acting like a modern cloud native app.

6:15

It's learning the new language.

6:16

Speaking of which, let's talk data.

6:18

Because automation is everything now.

6:20

Yes, and robots do not like reading messy text files.

6:23

They like structured data, specifically JSON.

6:26

Which is just a format that makes

6:27

it easy for computers to read.

6:29

And I saw Postfix 3.11 and added JSON output

6:32

for its command tools.

6:33

It did.

6:34

So now a script, a robot can query Postfix,

6:38

get a clean JSON response, and manage thousands

6:40

of servers automatically.

6:42

It makes Postfix easy for other machines to manage.

6:44

And it's not just text files for user data anymore either.

6:47

It can talk to all sorts of databases.

6:49

Oh, the list is extensive.

6:50

It's not just text files anymore.

6:51

Postfix 3.9 added support for MongoDB.

6:54

And it already supported MySQL, PostgreSQL, Swy, Redis.

6:58

Wait, MongoDB?

7:00

That's a super modern NoSQL database.

7:02

Why would an email server need to talk to that?

7:04

Think about a big company.

7:05

You have one central database with all your employees, right?

7:08

OK, sure.

7:08

Your single source of truth.

7:10

Exactly.

7:11

You don't have to remember to also go update a text

7:14

file on the mail server every time you hire or fire someone.

7:17

I get it.

7:18

So Postfix just plugs right into the main company database.

7:21

Right.

7:21

It asks the database in real time, does this user exist?

7:24

Are they still an employee?

7:26

If not, it rejects the mail.

7:28

It connects the email world directly

7:30

to the modern data world.

7:32

But connecting is only half the battle.

7:33

The other half is protection, because email

7:36

is the number one way the bad guys get in.

7:38

It's a very tough job.

7:40

And Postfix has some clever ways to handle it.

7:43

One of my favorites is a feature called Postscreen.

7:45

Postscreen.

7:46

Sounds like sunblock.

7:47

Think of it more like a zombie blocker.

7:50

A zombie blocker.

7:51

OK, I'm listening.

7:52

So you have all these compromised computers

7:54

out there, zombies that are part of botnets,

7:56

just spamming millions of servers.

7:59

If your mail server tries to have

8:00

a full, polite conversation with every single one,

8:03

it gets overwhelmed.

8:04

It runs out of resources.

8:06

Completely.

8:07

So Postscreen sits in front of the real server.

8:09

It does these really lightweight checks.

8:12

Is this IP on a blacklist?

8:13

Is it behaving strangely?

8:14

If it's a zombie, Postscreen blocks it

8:17

before it can waste the real server's time.

8:19

That's so smart.

8:20

Efficiency of security.

8:22

But what about the sneakier attacks?

8:23

I read about these trickle attacks.

8:25

Yes.

8:26

Imagine someone calls you, you say, hello.

8:28

And they say, hello, and then they wait 10 seconds.

8:30

Then they say, how, and wait another 10 seconds.

8:32

I'd hang up.

8:33

That's infuriating.

8:34

Exactly.

8:35

But old servers were too polite.

8:37

They'd wait.

8:37

And attackers would exploit that by sending data

8:40

incredibly slowly, one byte every few seconds,

8:43

just to tie up all the connection slots.

8:45

It's the passive aggressive denial of service attack.

8:48

It is.

8:48

But Postfix fought back.

8:50

They added per request deadlines and minimum data rates.

8:53

If you talk too slow, Postfix just hangs up on you.

8:56

Talk fast or get off the line.

8:58

I love it.

8:58

It's necessary.

9:00

And then, of course, there's encryption.

9:01

All the acronyms, TLS, SSL.

9:04

Right.

9:05

And Postfix is really modern here.

9:07

Back in version 2.11, they added support

9:09

for something called Dane TLS.

9:11

It's a way to use the DNS system itself to verify security

9:15

without necessarily needing a traditional certificate

9:17

authority.

9:18

It helps decentralize trust.

9:20

And then you have SNI, which lets one server host

9:23

multiple encrypted domains.

9:25

And require Teals.

9:27

That one sounds demanding.

9:29

It is.

9:29

It's a way for a sender to say, this message must be encrypted.

9:33

If you can't do it, don't even try to send it.

9:35

It's for when good enough security isn't good enough.

9:38

Which is critical.

9:39

But speaking of critical, there's

9:41

one area where Postfix is just absolutely obsessive.

9:44

And this is my favorite nerd corner fact about it.

9:46

I think I know where you're going.

9:48

The file system requirements.

9:49

Yes.

9:50

This blew my mind.

9:50

I always just assume when I save a file, it's saved.

9:53

But Postfix has some serious trust issues with hard drives.

9:56

It does, and for good reason.

9:58

It operates on a zero data loss mentality.

10:01

It requires that the file system properly

10:02

supports the fysync command.

10:05

OK, beginner translation time.

10:06

What is fysync?

10:07

So when a program tells a computer to write data,

10:10

the computer often cheats.

10:12

It sticks the data in fast memory and RAM and says,

10:14

OK, done.

10:16

It plans to actually write it to the physical disk later.

10:18

So the computer is lying to you?

10:20

It's being optimistic.

10:22

It assumes the power won't go out in the next two seconds.

10:25

But if it does, poof, the data is gone.

10:28

And for a mail server, that's a lost email.

10:31

Which Postfix finds completely unacceptable.

10:34

Fink is the command that says, no, you

10:37

will physically write this to the disk right now,

10:39

and you will not tell me you're done until you are actually

10:42

done.

10:43

I'll do it in a minute for an answer.

10:44

Never.

10:45

The documentation is explicit.

10:47

It says a file must not be lost.

10:49

If the system crashes right after Fink returns,

10:52

it demands that guarantee.

10:53

And it even warns about virtual machines, right?

10:55

Yes.

10:56

That's the amazing part.

10:57

It warns that the host machine can't cheat either.

11:00

The data has to go all the way to the physical metal.

11:02

That's digital banking level reliability.

11:05

It really is.

11:05

It shows that email isn't just casual chat.

11:08

It's infrastructure.

11:09

And Postfix takes its promises very, very seriously.

11:13

Which is funny, because we think of email as so instant,

11:15

but the back end is built to be bulletproof.

11:18

It has to be.

11:19

And it has to be global.

11:20

That's another area where it's adapted

11:22

with internationalization.

11:23

Right, because not everyone's email address

11:25

uses English characters.

11:26

Exactly.

11:27

For a long time, email was very ASCII-centric.

11:30

But Postfix 3.0 brought in full support for SMTPUTF8.

11:35

The ketty name.

11:36

It just means it can handle international email

11:38

addresses natively.

11:40

So email addresses and headers with, say,

11:43

Chinese characters or accents don't

11:45

turn into a bunch of gibberish.

11:47

That's huge for making the internet truly global.

11:50

And of course, it supported IPv6 for ages.

11:53

And it handles all the weird conversions

11:54

needed to make sure modern attachments don't

11:56

break old, ancient servers.

11:58

The universal translator, again, connecting

12:00

the old world to the new.

12:01

Exactly.

12:02

So when you step back, Postfix really is that, quote,

12:05

come to life.

12:06

All programmers are optimists.

12:08

But it's like, we'd see Venema was

12:09

an optimist who prepared for the absolute worst-case scenario.

12:13

That's a perfect description.

12:14

It's this optimistic workhorse.

12:16

It looks like the old stuff, but it

12:17

acts like modern infrastructure.

12:19

It speaks JSON.

12:20

It lives in containers.

12:22

It talks to MongoDB.

12:23

But deep down, it's all about that reliability.

12:26

That Fesync requirement is the heart of it.

12:28

It's like it's saying, I don't care how fast you want to go,

12:31

we are not losing this letter.

12:32

Precisely.

12:34

So what does this all mean for us,

12:36

the actual users hitting send?

12:38

Well, I think it leaves us with a provocative thought.

12:41

We live in this era of move fast and break things.

12:44

Apps crash, data glitches, services go down,

12:48

and we kind of just shrug.

12:50

But Postfix is a reminder that some software,

12:52

the deep plumbing of the internet,

12:54

is designed to never break things.

12:56

When you hit send on that important contract

12:59

or that job application, you're not relying on magic.

13:02

You're relying on that obsession.

13:04

You're relying on the fact that somewhere a server

13:06

is refusing to say okay until your message

13:09

is physically permanently written to a disk.

13:11

I love that, the invisible reliability

13:13

that keeps everything running.

13:14

Well, before we sign off, a quick reminder

13:16

about who helps keep us on the air.

13:18

SafeServer takes care of hosting this software

13:21

and supports you in your digital transformation.

13:24

More information at babyww.safe-server.iege.

13:27

Check them out.

13:28

And thank you for diving deep

13:30

into the internet's plumbing with us today.

13:32

Next time you send an email,

13:33

maybe take a second to appreciate the engine

13:35

getting it there.

13:36

See you on the next Deep Dive.

13:36

See you on the next Deep Dive.