Today's Deep-Dive: dma - DragonFly Mail Agent
Ep. 381

Today's Deep-Dive: dma - DragonFly Mail Agent

Episode description

In this episode, we explore what it really means to take control of your own email infrastructure by diving into DragonFly Mail Agent (DMA), a lightweight open-source mail transfer agent built for home and office use. Starting with the basics of how email actually moves across the internet, we unpack the difference between mail clients and mail transport agents, explain why DMA is intentionally outbound-only, and show how that design dramatically reduces complexity and security risk.

Along the way, we look at how DMA balances simplicity with modern security through TLS, SMTP authentication, and a small, auditable C codebase that follows the classic UNIX philosophy of doing one thing well. The conversation also expands into the bigger picture: how open-source tools like DMA lower the barrier to self-hosting, reduce dependence on expensive proprietary ecosystems, and give organizations more control over privacy, compliance, and data sovereignty. More than a technical deep dive, this episode is about rethinking digital infrastructure and asking where a simpler, more focused tool might serve us better than today’s bloated black-box platforms.

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

Imagine hitting send on a simple email. Yeah, just a standard message and

0:04

Instead of that satisfying digital whoosh you suddenly realize you have to build

0:09

this massive heavily armed

0:12

Constantly monitored digital fortress just to get that single message out the door.

0:17

That sounds completely exhausting

0:19

It really does but I mean for decades that was the harsh reality of running your

0:24

own digital infrastructure

0:25

Oh, absolutely. So today we are talking about taking back control of that

0:29

infrastructure

0:30

Yeah, and to do that we really need to recognize the supporter of this deep dive

0:34

Which is safe server, right? Because taking back control is a big step exactly

0:39

You know organizations constantly default to renting these incredibly expensive

0:43

proprietary tools from mega vendors like Microsoft or Google

0:48

Yeah, exactly for their daily communications mostly because building that fortress

0:51

just seems too hard

0:52

But safe server actually helps replace those massive systems with cost-effective

0:56

open source solutions

0:58

Which is so important today is especially when you're dealing with

1:02

legal regulatory or compliance requirements things like strict email retention

1:08

policies financial record audit trails or

1:11

You know rigorous data protection data sovereignty becomes totally non-negotiable

1:16

there, right?

1:17

You need to know exactly where your data lives and frankly who holds the keys to it

1:21

So safe server guides organizations through that entire process from the very

1:26

beginning from the initial consulting phase

1:28

Yeah to finding the exact right open source software fit right through to actually

1:32

operating your systems on highly secure German servers

1:35

You can explore all those possibilities at

1:37

www.safeserver.de

1:40

Well taking back that control usually starts with understanding the tools you're

1:45

actually using

1:45

I mean most of us interact with email every single day

1:48

But we treat it like a total black box the underlying mechanics are just you know

1:52

completely hidden from view

1:53

Well, we are opening up the hood on that black box today. We're looking at a really

1:57

fascinating piece of the Internet's invisible plumbing

2:00

Oh, yeah, the Dima project exactly. We're diving into a github repository

2:04

For a project called Dima which stands for the dragonfly mail agent and the

2:10

documentation

2:11

Really positions this software as a very beginner friendly entry point into open

2:17

source infrastructure

2:18

Which is rare in this space. It really is it's designed specifically for home and

2:23

office use

2:23

It basically strips away the massive walls of code that usually intimidate people

2:28

when they hear words like, you know

2:30

Mail server right because the first barrier to entry in this space is almost always

2:34

the terminology. Oh for sure

2:36

It's alphabet soup. Yeah, the documentation relies on this very specific sort of

2:40

historical division of labor in email architecture

2:44

It separates the whole process into MTAs and MUAs. Okay, so the source defines DMA

2:49

as a small mail transport

2:51

Agent or MTA and its designated job is to accept mail from a locally installed mail

2:57

user agent

2:58

That's the MUA right the MUA and then deliver it either locally or to a remote

3:02

destination

3:03

Let's let's try to ground that in the physical space for a second

3:06

I think an analogy would definitely help here

3:08

So think of the MUA as the person sitting at their desk, right?

3:12

They're writing a letter putting it in an envelope and actually writing the address

3:15

on the front

3:16

So that's your outlook your Apple Mail your Thunderbird interface exactly and the MTA

3:20

the mail transport agent is basically the mailroom down the hall

3:23

It takes that sealed envelope from you figures out the logistics and literally

3:28

loads it onto a truck to leave the building

3:30

The mailroom analogy works conceptually, but I'd add one major caveat there

3:36

What say this digital mailroom never sleeps it handles thousands of envelopes a

3:41

second and the roads it drives on are basically

3:44

Constantly collapsing. Oh meaning network outages precisely if we look at why this

3:48

division of labor even exists

3:51

It comes down to asynchronous processing. Okay unpack that a bit

3:54

Well, if your desktop mail program your MUA had to handle the actual physical

3:59

delivery of every single email across the global internet

4:03

Your entire workflow would just grind to a halt because it's waiting on the other

4:07

end, right?

4:07

Imagine hitting send but the receiving server in Tokyo happens to be temporarily

4:12

down or a router in the Midwest drops a packet

4:16

You just that program would just freeze

4:18

Exactly, you'd be staring at a spinning wheel

4:21

Completely locked out of your inbox while the software repeatedly tries to

4:24

establish a connection

4:26

So the local software the MUA just hands the envelope to the mailroom and

4:29

immediately walks away

4:31

Yeah, the user gets to keep typing the next email while the MTA takes on the whole

4:35

burden of waiting in line

4:36

The MTA takes on the entire burden of network latency and failure states

4:40

It cues the message it initiates all the complex digital handshakes with remote

4:46

servers

4:46

And if a connection fails it schedules a retry for 10 minutes later or maybe an

4:50

hour later

4:51

By focusing purely on that logistical transport side Dima acts as a highly

4:56

specialized

4:57

Incredibly lightweight courier right doesn't care about the font you used no not at

5:01

all

5:01

It strips out anything related to formatting text managing address books or

5:05

organizing folders

5:06

It handles routing and delivery full stop and that brings up a really fascinating

5:10

limitation

5:11

Detailed right there in the project's own github read me the disclaimer

5:16

Yeah, they state explicitly that Dima is not intended as a replacement for

5:22

Real big MTAs like send mail or postfix which is refreshing honesty

5:28

It is and they highlight a very specific technical boundary

5:32

Dina does not listen on port 25 for incoming connections, right?

5:37

And just for context port 25 is the standard entry point for incoming email traffic

5:42

across the global internet

5:43

It's the front door exactly when a server wants to hand an email to another server

5:47

It basically knocks on port 25, but wait if this software intentionally ignores

5:52

incoming connections on the main email port

5:54

It sounds like we're building half a bridge here. How do you mean?

5:57

Well, a mail tool for a home or office seems fundamentally broken if it explicitly

6:02

Refuses to receive mail from the outside world. Why would you want that?

6:06

You really have to view this through the lens of modern internet security. The

6:09

internet is exceptionally noisy

6:11

I mean it is saturated with automated botnets

6:14

Constantly scanning every single IP address in existence. Just looking for open

6:18

doors, right?

6:19

opening port 25 on a server is basically the equivalent of hanging a giant neon

6:24

sign outside your house that says I

6:26

Accept anonymous packages. Oh, wow. Yeah, there are IT veterans who still wake up

6:31

in cold sweats. Remembering the early days of

6:33

Server hosting, you know the open relay days. Yes, you'd accidentally leave port 25

6:39

open

6:40

Disconfigure one tiny setting and you'd come back from lunch to find your server

6:44

had been completely hijacked by a botnet

6:46

Just blasting out emails. Yeah, it just emailed half of Europe a massive spam

6:50

campaign for prescription pills

6:52

That is the exact nightmare scenario within minutes of opening port 25 automated

6:57

scripts will probe your server looking for an open relay

7:00

They just want to use your resources. Exactly. They want to exploit your hardware

7:04

to blast out spam while masking their own identity

7:07

Defending against that requires a heavily fortified infrastructure, which Dima is

7:10

not no not at all to defend port 25

7:13

You need complex configuration files real-time spam filtering IP reputation

7:19

management constant monitoring all the heavy lifting

7:21

Right. That is the job of a real big MTA like send mail or postfix

7:26

They are designed to stand on the front lines and fight off those botnets

7:30

So removing the doorbell entirely is the actual security strategy here exactly by

7:35

not listening on port 25

7:36

D may simply removes the attack sector

7:40

It cannot be targeted by external spam or automated open relay attacks

7:44

Because it literally just refuses to acknowledge anyone knocking from the outside

7:48

It acts as a quiet outbound only workhorse for your local network, but who only

7:53

needs outbound mail

7:54

You'd be surprised a massive amount of infrastructure requires outbound email

7:58

without ever needing to receive it like what think about it

8:02

Your backup server needs to email you a success log at 2 a.m. Your internal web

8:07

application needs to send a password reset link to a user

8:09

Right or an alert exactly a temperature sensor and a server closet needs to fire

8:14

off an emergency alert

8:15

None of those systems ever need to receive replies that makes total sense

8:18

So Dima takes the mail generated by those local machines and securely delivers it

8:23

out to the world

8:24

Completely bypassing the massive configuration overhead required to defend a public-facing

8:30

inbox

8:30

Okay, so knowing that it's an outbound only courier operating behind closed doors

8:36

We need to look at the mechanism of how it actually hands that mail off to the rest

8:40

of the world security and transit

8:42

Right because the internet doesn't give you a free pass on modern encryption

8:46

Just because your software footprint is small if you are transmitting passwords or

8:50

sensitive server alerts

8:51

The data must be secure in transit and balancing a tiny software footprint with the

8:56

mathematical density of modern encryption is a massive

9:00

Engineering challenge. Well, the repository files outlined exactly how Dima handles

9:04

this the documentation specifically highlights TLS

9:07

And SSL support along with SMTP authentication, which is standard modern security

9:12

Yeah, and we can see the proof in the source code files

9:15

You know names like crypto dot C base sixty four dot C and off dot conv

9:19

But the language breakdown in the repositories of what really caught my eye here

9:24

the C code

9:25

Yeah, the project is overwhelmingly written in the C programming language

9:29

Yeah, it sits at about eighty seven point five percent C with a total of four

9:33

hundred and eighty seven commits

9:35

That's the number of times developers have updated the code over its lifespan

9:39

C is the foundational language of modern operating systems

9:42

But it's powerful, but it places the entire burden of memory management on the

9:47

human writing the code

9:48

Okay, if you're listening to this and thinking why do I care about a decades-old

9:51

coding language?

9:53

hang with us for a second because this is where the vulnerability of

9:58

Early software hits your daily life. It really does because C requires developers

10:02

to manually allocate and free up computer memory, right?

10:05

Yes, one microscopic Tyco like one forgotten line of code to clear a memory block

10:10

and a malicious actor can overflow that memory

10:13

To inject their own code completely compromising the server. It happens all the

10:17

time in poorly written C

10:18

So how does a small home and office tool safely manage complex modern encryption

10:23

like TLS transport layer security?

10:26

Using a language notorious for manual memory errors in just a handful of files

10:30

The answer there really lies in the architecture of the code base and the principle

10:35

of modularity modularity

10:37

Yeah

10:37

if you look at the file list you've got crypto dot C and base 64 dot C sitting

10:42

right alongside net dot C for networking and

10:44

Mail dot C for routing logic. Okay, so it's broken up

10:48

Exactly and crucially Dema does not attempt to invent its own encryption algorithms

10:52

from scratch, which would be a bad idea

10:55

Oh writing custom cryptography and C is universally considered a terrible idea by

10:59

security professionals. Leave it to the experts

11:01

Yeah, right instead Dema's C code acts as a highly efficient bridge

11:06

It interfaces directly with the existing battle tested security libraries already

11:11

installed in your operating system like open SSL

11:13

Ah, so it's like a small storefront that doesn't try to build its own bank vault

11:17

out of plywood

11:18

I like that analogy. It just builds a secure pneumatic tube that routes the

11:23

transactions to the massive

11:25

Impenetrable bank vault next door. That's exactly it. The code footprint stays

11:30

Incredibly lean because it offloads all the heavy mathematical lifting to the

11:34

system, which is smart

11:35

It is and this leanness is actually its greatest security asset

11:39

When you only have a handful of C files doing very specific tasks the code becomes

11:44

auditable, right?

11:45

You mentioned it has 487 commits

11:47

Yeah, a dedicated developer could easily read through the entirety of Dimas code

11:52

base over a weekend

11:53

They can trace exactly how data flows from the local spool

11:57

Which is essentially the digital outbox waiting area on your machine right out to

12:01

the network. Where's a larger program?

12:03

Oh auditing a legacy behemoth like sendmail with its labyrinth of configuration macros

12:08

and literally thousands of source files

12:10

That can take teams of experts months

12:14

Yeah

12:14

You can't hide a malicious backdoor or a glaring memory leak in a 10 page document

12:18

as easily as you can bury it in a

12:20

10,000 page manual the simplicity ensures that your home or office server can

12:24

securely authenticate with remote destinations

12:27

Proving who you are to Google or safe server or wherever you're routing the mail

12:32

without bloating your local system with unnecessary code

12:35

It is a textbook application of the UNIX philosophy

12:39

Which is write small programs that do one thing do it exceptionally well and make

12:44

sure they can talk to other programs

12:45

Love that. Okay. So the code is

12:48

lean and auditable

12:50

But source code doesn't send emails running software does true and historically

12:56

turning raw

12:56

C-code into a running application was a brutal barrier to entry for anyone trying

13:01

to self-host their own infrastructure

13:03

Oh, it was a nightmare

13:04

You have to download the raw text files ensure you had the correct compilers

13:08

installed decipher complex

13:10

prerequisite libraries just reading that hurts my brain and then you'd run the

13:13

build process basically just praying it didn't terminate with a

13:16

Cryptic error online 4000. Well the building section of the DMA readme actually

13:21

still contains those old-school instructions

13:22

Oh, it does. Yeah, it outlines the process of compiling, you know using a program

13:28

to

13:28

Translate human readable C code into the binary machine instructions your computer

13:33

processor actually understands right the make commands

13:36

Yeah for Linux it tells you to type make for BSD systems

13:40

It's CD BSD and then make and then the installation. Oh man, then comes the

13:45

installation command

13:46

It's like make install it send mail link mail clink install spool deers install it.

13:51

Etc. It's a lot

13:51

It looks like an ancient incantation

13:53

You are manually telling the computer where to put the executable files

13:58

How to link them and exactly where to create the spool directories and the problem

14:02

is

14:02

One incorrect permission setting on just one of those directories and the entire

14:08

mail agent fail silently

14:10

Just dead in the water. Yeah, but and this is the best part the documentation

14:13

highlights a massive shift

14:16

In how we deploy this kind of software today. Thank goodness

14:19

Yeah, you don't actually have to type any of those make commands anymore. I'll

14:21

package managers

14:22

Exactly. The project lists the exact simple commands used by modern package

14:27

managers

14:28

So on freebsd you open your terminal and type pkg install dima on ubuntu

14:33

Which is arguably the most popular distribution for home servers

14:38

It's just sudo apt install dima and arch linux arch users type yard digest dimar

14:44

It's amazing a single command line execution basically replaces an hour of manual

14:48

compiling and directory configuration

14:50

The contrast is staggering for anyone who's intimidated by server administration

14:54

I mean instead of reading a sprawling manual to compile source code you type three

14:57

words hit enter and in about five seconds

15:00

A fully functioning secure mail transport agent is actively running on your machine

15:04

This is exactly where we see the invisible labor of the open source community at

15:08

work. How so?

15:09

Well the repository statistics you mentioned earlier hold the key to this ease of

15:13

use

15:13

All right, so it has 255 stars and 54 forks which indicates active interest and

15:18

experimentation from other developers

15:20

But more importantly it lists 34 direct contributors. Those 34 contributors are the

15:26

bridge

15:26

They're the bridge between the complex c code and that simple apt install command.

15:31

They're the package maintainers exactly

15:33

They took the original developer's code. They ran those complex make commands

15:37

Figured out exactly which directories the files need to live in for uber 2

15:42

Configured all the exact security permissions required and bundled it all into a

15:47

neat downloadable package

15:49

So they absorb the friction. Yes, they absorbed all the friction

15:52

So the end user doesn't have to deal with it

15:54

And honestly their labor is exactly why duma is prominently featured on the awesome

15:58

self-hosted list. That's a great list

16:00

It is for those who don't know that list is a highly curated directory of software

16:06

Specifically chosen because it respects user privacy and allows individuals to

16:10

reliably run their own digital lives

16:13

And software does not make that list if it requires a computer science degree just

16:17

to keep it running

16:17

Definitely not being included means duma is trusted by a community that really

16:22

prioritizes self-reliance and stability. It democratizes

16:25

Infrastructure, you know, you no longer need a dedicated it department to handle

16:30

your internal server routing

16:33

The barrier to entry has essentially vanished and lowering that barrier

16:37

Fundamentally changes the strategic calculation for organizations of all sizes.

16:42

Absolutely if setting up specialized infrastructure is this accessible

16:46

relying on

16:48

bloated

16:49

Proprietary ecosystems is no longer a mandatory cost of doing business

16:53

Which you know really brings us back to the core mission of safe server, right?

16:58

Because when the technical friction disappears, you can make decisions based on

17:01

your actual needs rather than just technological lock-in exactly

17:05

So a growing business a non-profit association or really any group managing their

17:10

own data

17:10

Might just need a lightweight tool like Dima to quietly handle internal server

17:14

alerts where they might need something bigger, right?

17:17

They might need a comprehensive open source alternative to replace their entire

17:21

Expensive proprietary email suite across a hundred employees. Yeah, but in both

17:25

scenarios, the cost-saving potential is immense

17:28

You're not trapped. No, you do not have to pay per user per month licensing fees to

17:34

tech conglomerates

17:35

Just to route internal communications and more importantly you maintain total

17:39

sovereignty over your data

17:41

Which is critical but transitioning away from those massive vendors can still feel

17:45

daunting

17:45

Which is exactly why safe server can be commissioned for consulting

17:49

They assess your specific operational needs and help you find and implement the

17:54

right open source architecture

17:55

Whether it's an intricate setup for a massive enterprise or just a simpler

17:59

alternative for a small team

18:01

Exactly. They ensure the solution fits and they can even host it on secure German

18:05

servers

18:05

You can explore those consulting and hosting options over at

18:09

www.safeserver.de

18:11

You know understanding the mechanics of a tool like daemma reveals a really

18:15

important lesson. What's that? Enterprise grade reliability doesn't always require

18:19

Enterprise grade bloat that is so true. We live in an ecosystem where technology

18:24

companies are constantly pushing to add more

18:26

every simple application on your phone suddenly demands to be an AI assistant a

18:31

Social network and a data harvesting platform all simultaneously bloatware and

18:35

feature creep have basically become the default state of the modern Internet

18:39

They really have yet. Here is this tiny collection of C files net dot C

18:43

Crypto dot C mail dot C that securely routes encrypted communications across the

18:48

globe explicitly

18:50

Refuses to do anything else and quietly gets out of your way the second its job is

18:54

done. It's elegant

18:56

It is so ask yourself

18:58

Where else in your digital life might you benefit from replacing a bloated tracking

19:02

That just does its job and leaves you alone

19:02

That just does its job and leaves you alone