Today's Deep-Dive: DMRC Report Viewer
Ep. 270

Today's Deep-Dive: DMRC Report Viewer

Episode description

The DMRC Report Viewer is an open-source tool designed to simplify the management of email security reports, particularly DMRC and SMTPTLS reports, which are crucial for maintaining email server security. These reports, often overwhelming due to their XML and JSON formats, are parsed and visualized by the viewer, making them accessible even to beginners or small administrators. The tool is a lightweight, single-file executable written in Rust, requiring no additional dependencies, making it ideal for small deployments and even running on a Raspberry Pi. It uses a built-in IMAP client to securely fetch reports from an email account, offering a web-based interface with charts and visualizations to provide clear insights. The viewer also includes features like DNS lookups, webhooks for notifications, and automatic HTTPS setup using Let’s Encrypt, enhancing both usability and security. Its stateless design, keeping data in memory, prioritizes real-time insights over long-term data storage, making it suitable for regular security checks but not for deep historical analysis.

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 for 1 Euro - 30 days free!

Download transcript (.srt)
0:00

Welcome to the deep dive before we jump in today.

0:02

Just a quick shout out to the supporter who makes this deep dive possible.

0:06

Safe server, safe server handle software hosting, you know,

0:09

like for tools we might even discuss today.

0:11

And they support your digital transformation.

0:13

Find out more at www.safeserver.de.

0:18

All right. So today we're tackling something that can be a real headache

0:23

if you manage your own email server security reports. Oh, yeah.

0:27

Especially if you're self-hosting, right?

0:29

You're trying to keep everything secure, keep your domain reputable.

0:33

And that means dealing with DMRC reports, SMTPTLS reports.

0:36

And they're vital, absolutely vital.

0:38

But they show up how?

0:40

As these just massive, completely baffling XML and JSON files in your inbox.

0:45

Exactly. It's pure information overload.

0:47

If you're running a smaller mail server, maybe just for yourself or a small group,

0:51

you need to know if your emails are authentic, if they're encrypted properly.

0:54

But staring at thousands of lines of code.

0:56

Well, it's just not practical.

0:59

Feels like reading an alien language sometimes.

1:01

And that really sets up our mission for this deep dive, doesn't it?

1:04

We found the solution.

1:05

It's called the DMRC report viewer.

1:07

It's an open source tool.

1:09

Seems specifically built to fix this exact problem without needing,

1:13

you know, a giant enterprise setup.

1:15

That's the one we're diving into.

1:17

It's GitHub repo.

1:18

It's this lightweight application, basically a single file written in Rust.

1:22

And our goal is to really unpack how this little executable

1:26

takes those overwhelming reports and turns them into clear, useful insights,

1:31

stuff a beginner or small admin can actually use quickly.

1:35

OK, let's unpack that for someone maybe just starting out with mail administration.

1:38

I know DMRC is important. I hear about it.

1:40

But what exactly are these two report types?

1:44

And what's the viewer actually doing with them?

1:46

Right. Let's break it down.

1:47

DMRC reports, think of those as confirmation slips

1:49

from other big mail servers like Gmail or Microsoft.

1:52

They tell you, hey, we got an email claiming to be from your domain.

1:55

Did it pass our checks? OK.

1:57

If it failed DMRC, it usually means one of two things.

1:59

Either your set up, your SPF or DQM records has an error

2:03

or someone's actively trying to spoof your domain, pretending to send email as you.

2:08

These reports basically verify your authentication is working.

2:11

Gotcha. And the SMTPTLS ones.

2:14

Different focus. Totally different.

2:17

Those are all about privacy during transit.

2:19

When your email travels from your server to the recipient's server,

2:22

was that connection encrypted?

2:24

Right. Like using TLS encryption.

2:26

Exactly. If you see failures in those reports,

2:29

it might mean emails being sent unencrypted sort of in the clear.

2:32

Or maybe the receiving server had issues negotiating the security handshake.

2:36

So the viewer's core job, it takes all that raw XML data,

2:41

which holds all this audit info, parses it, meaning it reads and understands it

2:45

and then displays it in a way that makes sense. Nicely visualized.

2:48

And that parsing bit is the real time saver, isn't it?

2:51

Saves hours of trying to do it by hand.

2:53

OK, so the architecture here is really interesting, especially for the self-hoster

2:56

crowd.

2:57

You mentioned it's not some big heavy application needing its own database or

3:00

Python or other stuff.

3:02

Yeah, precisely. The description is key.

3:04

A single fully statically linked executable written in Rust.

3:09

And statically linked. That sounds technical, but what does it mean practically?

3:14

It basically means everything the application needs to run is bundled into that one

3:18

single file.

3:19

The part that reads the reports, the part that connects to your email,

3:23

the part that runs the little web server for the interface. It's all in there.

3:26

Ah, okay. So no dependency help.

3:30

Exactly. You download it, set a few configuration options, and just run it.

3:34

No installing libraries or frameworks first.

3:36

So if I move it to another computer, it should just work?

3:40

Pretty much. That standalone simplicity is a huge advantage for smaller deployments,

3:44

definitely.

3:45

And it really speaks to how lightweight it is.

3:47

Absolutely. And the documentation specifically mentions that it runs out of the box

3:53

on a Raspberry Pi.

3:54

Wow. Okay. That tells you straight away the resource footprint is tiny.

3:58

It really does. Minimal CPU, minimal memory.

4:00

And for people using Docker, that small size must be a big win, too.

4:04

Oh, hugely. There's a Docker image available in the GitHub container registry.

4:08

And get this, it's 10 megabytes.

4:10

10? Seriously?

4:11

10 megabytes. Tiny. That means you can download and deploy it almost instantly,

4:17

even on a slow connection.

4:18

No waiting for huge layers to download.

4:20

Plus smaller attack surface.

4:22

Good point. Keeps things lean and mean from a security perspective, too.

4:26

That flexibility is great for someone trying it out in a home lab or for a small

4:29

business setup.

4:30

Okay, so mechanics. How does it actually get the reports? Does it watch a folder or...?

4:37

It actually uses a built-in IMAP client, a secure one.

4:41

Okay.

4:41

You just tell it which email account gets those DMRC and TLS reports.

4:45

It connects securely defaults to IMAPs on port 993, the standard secure port.

4:50

What if my server uses StartLS?

4:52

It handles that, too.

4:53

If you need to use port 143 for StartLS, you can configure it that way.

4:57

Secure connection is a priority.

4:58

Can I point it at, say, different mailboxes for different report types?

5:02

One for DMR, one for TLS?

5:03

Ah, good question.

5:05

You can tell it to look in different folders within the same email account.

5:08

So you could have a DMR reports folder and a TLS reports folder.

5:11

But the documentation does say that fetching from completely separate email

5:15

accounts isn't

5:16

supported right now.

5:17

OK, so you'd need to funnel reports into one monitored mailbox.

5:21

Maybe using forwarding rules or something.

5:23

Yeah, exactly.

5:24

Consolidate them first.

5:25

And you control how often it checks for new reports.

5:29

Yep.

5:29

You can set a simple interval, like check every hour, every 30 minutes.

5:34

Or if you want more precise control, you can use a standard cron expression.

5:37

Got it.

5:38

So it securely pulls the reports, parses the XML, then what?

5:43

You mentioned a web UI.

5:44

Right, that built-in HTTP server provides a web interface.

5:49

And it's designed to be responsive.

5:50

Meaning it works OK on phones and tablets.

5:53

Yeah, should adapt nicely to smaller screens.

5:55

The main thing is the dashboard, though.

5:57

It's not just a raw list of reports.

5:59

It gives you summaries.

6:01

This is where it gets really interesting, I think.

6:03

It visualizes the data.

6:04

You get charts showing which domains and organizations are sending you reports.

6:08

How many passed, how many failed.

6:10

OK, give me an example.

6:11

What kind of insight would that give me that just looking at raw numbers wouldn't?

6:14

Well, imagine you see a spike in deem or failures.

6:17

The chart might immediately show they're all coming from one specific block of IP

6:22

addresses.

6:23

Maybe linked to one organization you don't recognize.

6:25

Oh, OK.

6:26

Instead of just seeing a thousand failures, you instantly see where they're coming

6:29

from.

6:30

Maybe it's a configuration mistake you made.

6:31

Or maybe it's somebody trying to spoof your domain from that IP range.

6:35

Exactly.

6:35

It shifts you from just checking your config to potentially spotting an active

6:39

attack.

6:39

That's the insight.

6:40

So it's more than just a viewer.

6:42

It's leaning into being a bit of a forensic tool.

6:44

What else helps with that kind of investigation?

6:46

Well, alongside those ranked sources, the tool has built-in lookups.

6:51

This is crucial for any source IP address sending your reports.

6:56

You can click to look up its DNS records, its geographic location,

7:00

who information you know, who owns that IP block.

7:03

Oh, that is useful.

7:04

So if I see tons of failures from an IP in, say, a country I never do business with.

7:10

Right. You can instantly check who owns it.

7:12

Is it a known cloud provider or something suspicious?

7:16

That helps you decide your next move,

7:18

like maybe tightening your DMARC policy from monitor to quarantine or reject.

7:24

Does it handle reports that aren't quite right?

7:26

Sometimes they can be malformed.

7:28

Yeah, it does try to be robust.

7:30

It'll actually show you if it encountered parsing errors with specific reports,

7:34

which can help you figure out if the sending system has a problem.

7:37

And you can connect it outwards, too.

7:39

Yes. There's a webhook feature.

7:41

So when a new report comes in, especially maybe one showing a high failure rate,

7:46

you could have the viewer automatically ping another service.

7:50

Like send a notification to a chat system or trigger some other automation.

7:54

Precisely. Connect it to your wider monitoring setup.

7:56

Okay. Let's switch gears to setting it up.

7:58

Configuration sounds straightforward, especially with Docker.

8:01

Yeah. Mostly done via environment variables.

8:03

Super easy for Docker. You just pass the variables,

8:06

like your IMP server details, username, password, when you run the container.

8:11

And there was something about handling large emails.

8:14

Right. That's a neat operational detail.

8:15

You can configure a maximum size for the emails it processes.

8:19

This is a safeguard, basically.

8:20

Prevents some giant, maybe misclassified spam message from accidentally getting

8:26

treated

8:26

like a report and crashing the viewer by using up all the memory.

8:29

Smart. Now, security of the viewer itself.

8:32

If this thing is showing my potentially sensitive security reports,

8:36

I need to protect that web UI.

8:38

Absolutely. By default, it uses basic authentication.

8:41

You set a username and password, and anyone accessing the web UI has to enter them.

8:45

That's the recommended approach.

8:47

But you can turn it off, maybe, if you have something else handling security.

8:50

You can. If you're putting it behind, say, a reverse proxy like nginx or caddy,

8:55

and that proxy is handling authentication and HTTPS for you,

8:59

then you can disable the built-in basic auth just by setting an empty password in

9:02

the configuration.

9:03

Gives you flexibility.

9:04

Okay, and speaking of HTTPS, you mentioned something really cool there,

9:07

a standout feature for simplifying setup.

9:10

Yeah, this one's pretty slick, especially for a lightweight tool like this.

9:13

It has built-in automatic HTTPS using Let's Encrypt certificates.

9:18

Lots of tools do Let's Encrypt now, but this one has a twist.

9:21

It does. Normally, Let's Encrypt needs to verify you control the domain

9:25

by connecting back to your server on port 80, the standard HTTP port.

9:30

This tool uses a different method called the TLS ALPN-AERO1 challenge.

9:35

Okay, and the practical upshot of that is?

9:37

The verification happens directly over port 443, the standard HTTPS port,

9:41

which the tool is already using for its own web server.

9:44

Ah, so you don't need to open port 80 on your firewall just for certificate removal.

9:48

Exactly. That's the huge convenience. For anyone managing firewalls,

9:52

especially if port 80 is normally closed or used for something else,

9:55

avoiding that requirement is a massive simplification.

9:57

It just handles HTTPS setup cleanly over 443.

10:01

That's genuinely elegant. Very admin-friendly.

10:04

Okay, finally, let's circle back to that key design point.

10:06

How it handles data. No database.

10:09

Right. This is probably its most defining feature.

10:12

It doesn't store the reports long-term in a database or even in files on the server.

10:16

So where is the data?

10:18

It's kept entirely in memory while the application is running.

10:21

When you load the web page, it fetches the reports fresh from your IMAP account,

10:25

parses them, analyzes them, and displays the results.

10:28

Wow. Okay, that explains the lightweight nature, but what are the implications?

10:33

If I've got, say, a year's worth of reports in my mailbox,

10:37

is it going to try and load all of that into the RAM of my little Raspberry Pi?

10:41

That's the crucial trade-off, isn't it? It forces you to think about scale.

10:45

Because it pulls fresh from IMAP each time,

10:48

it's really optimized for looking at recent reports, maybe the last few days or

10:51

weeks.

10:52

It's built for the admin who checks their security status regularly, daily or

10:56

weekly.

10:56

So, not really designed for digging through massive historical archives going back

11:01

years.

11:02

Probably not at strength, no. You get incredible simplicity,

11:04

zero database maintenance, extreme portability. But you trade away the ability to

11:09

do complex

11:09

queries across a huge historical dataset that would typically require a database.

11:14

It relies on your IMAP server for the actual long-term storage.

11:18

So, it prioritizes that real-time view, that immediate insight over deep history.

11:23

That seems to be the core design philosophy, yes. Speed and simplicity for current

11:28

status.

11:29

And the only thing it does save to disk is?

11:31

Just the certificate cache folder. If you use that automatic let's-encrypt feature,

11:35

you need to make sure that folder persists across restarts.

11:39

Otherwise, it would have to get a new certificate every single time.

11:42

Right, that makes sense. Otherwise, it's essentially stateless, pulls fresh data

11:46

every time.

11:46

Pretty much. Depends entirely on your IMAP store for the history.

11:50

Okay, so wrapping up our deep dive on the DMRC Report Viewer, we've seen how this

11:56

Rust application

11:57

really simplifies handling those complex email security reports. It automatically

12:01

fetches them,

12:01

parses them reliably, gives you those useful charts and visualizations, like the IP

12:05

lookups,

12:06

which are great. And the deployment is just super simple, either as a single file

12:10

or that

12:11

tiny 10-millibit Docker image, plus the security features like the clever Let's Encrypt

12:16

integration.

12:17

We have indeed. And maybe a final thought for you, the listener, to mull over.

12:22

Given that this tool

12:23

takes that stateless in-memory approach, relying on fresh IMAP data, how might you

12:28

best combine

12:29

its strengths, that great real-time insight, with maybe a different strategy for

12:33

long-term archival?

12:34

You know, ensuring you meet both your need for immediate threat analysis and your

12:38

requirements

12:39

for longer-term security auditing down the line, finding that balance could be key.

12:43

That's a really interesting point to consider, how to blend real-time tools with

12:46

archival needs.

12:48

And that brings us to the end of this deep dive. Thanks again to Safe Server for

12:52

supporting the

12:52

show. Remember, Safe Server is there for your digital transformation, hosting needs,

12:57

Check them out at www.safeserver.de. We'll catch you on the next one.

12:57

Check them out at www.safeserver.de. We'll catch you on the next one.