Dev

Self-Hosting Email the Hard Way: Acquiring Your Own IPv4 Block

Cambridge professor refreshes Recoil infrastructure, operational since 1997. A detailed technical article explaining how to obtain your own routable IPv4 address block and improve email deliverability.

6 min read Reviewed & edited by the SINGULISM Editorial Team

Self-Hosting Email the Hard Way: Acquiring Your Own IPv4 Block
Photo by Mariia Shalabaieva on Unsplash

Running your own mail server is an excellent way to deeply understand how the internet works. Professor Anil Madhavapeddy of the University of Cambridge, alongside his friend Nick Ludlam, has refreshed the Recoil hosting infrastructure they have operated since 1997 and published a detailed technical article covering its entirety. Particularly notable is the approach of acquiring their own routable IPv4 address block to ensure email deliverability on their own terms.

Email may appear to be a single service to many users, but it actually consists of three independent functions: receiving, sending, and access. Madhavapeddy’s article provides concrete implementations for each.

Why Self-Host Email?

Madhavapeddy cites educational value as the primary motivation for self-hosting. Drawing on his own experience installing OpenBSD and fixing a PHP bug, he states, “Running your own server teaches you how the internet actually works.” In a broader context, he points out the importance of maintaining sovereign access to your own data as the web becomes consolidated into a handful of platforms.

A 2023 analysis by Jan Schaumann reported that “most email traffic can be read by just two companies: Google and Microsoft.” Even if your own domain does not use these mail servers, as long as many of your recipients do, the effect is essentially the same. Email is central to digital life; if it is compromised, many other accounts are put at risk.

However, self-hosting comes with considerable effort. Madhavapeddy explains that this effort is spread over a long period, requiring you to find stable internet hosting and build IP reputation. Home networks are not recommended; he uses a local trusted provider, Mythic Beasts.

Challenges of Receiving Email

The biggest barrier to receiving email is the reputation of the sending IP address. Many email providers reject mail from unknown IPs. To solve this problem, Madhavapeddy enlisted the help of his friend Thomas Gazagnaire (based in France) to make a dedicated IPv4 address block routable by their own means. This makes it less likely for emails sent from their IPs to be blocked.

The article also introduces email filtering using the Sieve language as a bot countermeasure. Sieve is a standard server-side method for sorting email, effectively eliminating spam and automated transmissions.

How to Obtain Your Own IPv4 Block

Acquiring your own IPv4 block requires cooperation with a suitable hosting provider and knowledge of BGP routing. Madhavapeddy details the specific steps in the article. The key point is to be able to announce the IP address range you control on the internet. This requires the provider to support BGP, which Mythic Beasts does. IPv4 addresses are no longer easily obtainable, but methods include splitting existing blocks or purchasing from the IP address market.

Ensuring Reliability of Outgoing Email

On the sending side, four technologies must be properly configured: SPF, DKIM, DMARC, and SRS. SPF publishes in DNS which servers are authorized to send email from your domain. DKIM attaches an electronic signature to emails to prevent tampering. DMARC defines a policy based on SPF and DKIM authentication results. SRS is a mechanism to prevent SPF authentication from breaking during email forwarding.

Properly configuring these significantly reduces the risk of other mail servers mistakenly marking your email as spam. Madhavapeddy explains these settings with concrete DNS record examples. To improve email deliverability, it is not enough simply to set up a server; a complete implementation of these authentication technologies is essential.

Building a User Access Environment

For users to read email, the setup employs Dovecot as the IMAP server and Roundcube as the webmail client. Dovecot is a widely used fast and secure IMAP server. Roundcube is a PHP-based webmail application that is visually appealing and extensible via plugins. With proper configuration, it can deliver a user experience comparable to commercial mail services.

Future Challenges and Research Ideas

The article concludes by outlining remaining issues with the current setup and directions for future research. Examples include automatic email encryption (Autocrypt or PGP), more advanced spam filters (such as Rspamd), and enhanced IPv6 support. In the world of self-hosting, improving transport security with technologies like DANE and MTA-STS is also an important theme.

Madhavapeddy positions this project not merely as a technical curiosity, but as a contribution to internet decentralization and data sovereignty. Such self-hosting movements extend beyond email. As previously reported on this site, the open-source NotebookLM alternative “Open Notebook” (related article) is a project allowing users to manage their note data themselves. Like email, the trend toward valuing data sovereignty is clearly strengthening.

[Reference] Anil Madhavapeddy, “Self-hosting email the hard way from your own routable IPv4 block up”, published via Lobsters (2026-06-08). https://anil.recoil.org/notes/recoil-self-hosting-2026

Editorial Opinion

In the short term, the publication of detailed practical guides like this article may accelerate the trend of technically savvy individuals and small organizations running their own mail servers. The sharing of methods for building IP reputation independently is particularly significant in an era of increasing centralization around Gmail and Outlook.com. However, the exhaustion of IPv4 addresses continues, making the barrier to acquiring a dedicated block higher each year. Madhavapeddy’s case relies on years of networking contacts and specialized knowledge, and it is not something beginners can easily replicate.

In the long term, email decentralization contributes to the resilience of the internet, but considering the maintenance costs and the skill requirements for security management, average users will not be able to follow suit quickly. Rather, this article suggests the importance of re-evaluating the value of email as a communication medium independent of large platforms, and deeply understanding the standard technologies involved (SPF/DKIM/DMARC/Sieve, etc.). The editorial team hopes that such efforts will strengthen the knowledge base of the community as a whole and eventually lead to the development of more user-friendly self-hosting tools.

An editorial question for you: Do you think it is worth hosting your own email? Where should you draw the line between the convenience of major email services and data sovereignty? Using this article as a starting point, readers might consider rethinking their own email strategies.

References

Frequently Asked Questions

What is needed to self-host a mail server?
You need a stable hosting environment (e.g., VPS), mail server software (Postfix, Dovecot), DNS knowledge, and configuration of SPF/DKIM/DMARC. Additionally, for building IP reputation, a dedicated IPv4 block or a hosting provider with high reputation (e.g., Mythic Beasts) is recommended.
How can I improve IP reputation?
When starting from a new IP address, gradually increase sending volume to avoid being flagged as spam. Proper reverse DNS (PTR record) setup, full implementation of SPF/DKIM/DMARC, and registration in feedback loops (FBLs) are also effective. As introduced in this article, managing your own IPv4 block can reduce the risk of being blocked.
Are there recommended providers for self-hosting email?
This article introduces Mythic Beasts (UK). Providers with BGP support (e.g., OVHcloud, Hetzner, Linode) are also options. Home networks are not recommended due to IP reputation issues; data center hosting is preferred.
Source: Lobsters

Comments

← Back to Home