← All posts

Running my own email, including the awkward bits

Email is one of the services I want to operate myself. It carries conversations, account recovery links, and a fair amount of the administrative background noise of life. Having control over where it lives matters to me. I also value that email is something anyone can operate and still use to communicate with everyone else. That's the sort of internet I'd like to keep practical.

It also connects my setup to systems run by other people. They need to be able to send messages to me, and my messages need to reach them. That makes email a larger commitment than hosting an application only I use.

My setup uses mailcow on a separate Hetzner machine in the EU, outside the Kubernetes cluster. mailcow brings together the components needed to run a mail service, which reduces the integration work. I still have to maintain the machine and verify that the service behaves correctly.

Following a message

A mail service has several stages worth distinguishing. A remote server must be able to connect and deliver a message. The mail system must accept or reject it appropriately, process it, and make accepted mail available to the user.

Outbound mail adds the behaviour of the receiving provider. A successful local submission does not guarantee inbox placement. DNS configuration, authentication, connectivity, and reputation all affect the result. The hidden-primary DNS setup is therefore part of the mail service's dependencies, even though it runs separately.

For a small setup, a managed mailbox is often the simpler option. Running the service myself gives me access to its configuration, data, and logs, but also gives me responsibility for investigating failures across those stages.

Sender -> public DNS -> mail server -> mailbox
                                         |
                                         v
                              account-recovery messages

Mail can be a route back into other accounts. Losing access to it, or letting an attacker read recovery messages, can therefore affect more than correspondence. Multi-factor web login also does not prove that every mail-client credential or existing session receives the same protection. Those paths need their own access and revocation checks as part of the security work.

Seeing enough to investigate

Monitoring runs in Zebra, my Kubernetes cluster, and has two views of the separate mail machine. An exporter, a process that turns service information into monitoring metrics, queries the mailcow API for service-level information. Grafana Alloy, a telemetry collection agent on the mail machine, sends host metrics and logs back to the monitoring stack.

The distinction is useful during an investigation. The API can report mail-system state, while host metrics help explain resource pressure and logs show what happened to particular messages or connections.

The telemetry agent sends data out rather than requiring another publicly accessible monitoring listener. That keeps the collection path narrower, although credentials, transport, and access to the collected logs still need care. Mail logs can reveal information about correspondents even without containing message bodies.

Living with the responsibility

Queue counts, resource metrics, and logs help investigate mail problems, but do not prove that all mail is arriving. A proper operational check also needs representative delivery tests, a verified backup and restore process, and a way to receive important alerts if mail itself fails. The ntfy alerting path gives me a delivery channel to consider alongside email, with its own availability limits.

I've lost mailcow completely and recovered it from month-old backups because newer backups weren't working. That was a real recovery, with an unwelcome gap in recent data. It doesn't establish the current backup age or procedure, but it explains why checking the backup process itself matters to me.

Hetzner hosting separates mail from the home equipment. Mail's own backups, credentials, and restoration still need attention; the cluster's backup jobs don't automatically cover it.

Those are details I want documented before presenting this as a setup guide. Copying an installation without the recovery and delivery checks would omit much of the work that makes it usable.

I wouldn't tell you to run your own mail just because you can. A managed mailbox is a reasonable choice. If the control appeals to you as it does to me, make room for delivery checks, recovery, and a way to hear about trouble when email itself is broken. Installing mailcow is the beginning of that job.

← Back to the notebook