Email on My Personal Domain for Free (Without a Mail Server at Home)
Cloudflare Email Routing for inbound mail, any IMAP mailbox for storage, Mailjet as an authenticated relay with SPF, DKIM and DMARC: how I put email on christianperoni.dev together in half an hour for zero euros, without opening a single port at home.
In my last two articles I described how I turned an HP ProLiant MicroServer Gen8 into a private cloud (Nextcloud, Collabora and Vaultwarden) and then used it to clean up my home network with Pi-hole v6. With those services in production and the christianperoni.dev domain already managed on Cloudflare, the next step was almost inevitable: having email addresses on that domain. info@, me@ and whatever other alias I came up with.
The constraint was clear: no monthly per-seat subscription to Google Workspace or Microsoft 365. I’m a developer, not a sysadmin, and for a single person it wouldn’t be a dramatic amount of money — but it is still a recurring cost for a service that, in my head, had to cost the same as the rest of my infrastructure: nothing.
So the first temptation was the obvious one: “I have a server at home running 24/7, why not spin up a mail server with Docker?”. It was also the idea I discarded faster than any other. This article is about why, and about the architecture I built instead.
Why I Didn’t Host a Mail Server at Home
Running a web server or a DNS resolver at home is fun and relatively painless. Running mail on a residential line is a different matter, for three very concrete reasons.
- Port 25 is blocked. Almost every residential ISP blocks outbound traffic on port 25 — the one SMTP servers use to talk to each other — to keep infected PCs from turning into spam cannons. The motive is sound; the practical consequence is that your server can receive but cannot send.
- No static IP, no reputation. A home connection has no dedicated, stable public IP. Even if you managed to push mail out, Gmail, Outlook and friends would treat it with suspicion, because it comes from a residential range with no PTR (reverse DNS) record matching the sending domain.
- Maintenance and risk. If the box at home goes down for an update or a blackout while you’re waiting for an important email, you either lose messages or drown in retry queues, backups and an archive that lives on a single disk.
So the goal changed: I don’t want to run the transport infrastructure, I just want to use my domain to send and receive mail reliably, for free, with full control over the data.
The Architecture in Three Pieces
A single free service that does everything doesn’t exist. So I split the problem into three independent pieces, each solved with the best free tool available.
- Inbound and routing: Cloudflare Email Routing. The domain is already managed on Cloudflare, the service is completely free, it allows up to 200 routing rules (plus a catch-all to receive mail on any alias invented on the spot) and it runs on their global network.
- Storage: an IMAP mailbox. Cloudflare only forwards, it doesn’t store anything. You need a real mailbox to park messages in and read over IMAP. Which provider to pick is a topic of its own, because it’s the decision with the most variables.
- Outbound: Mailjet as a transactional relay. If I replied through the mailbox provider’s SMTP server with a
@christianperoni.devsender, recipients would block me: that server isn’t authorised to send on behalf of my domain. You need a service that sends in your place, authorised through DNS. - Client: any mail client. The entry point where IMAP reading, sending through the relay and alias management come together. Any app that supports IMAP, SMTP and multiple identities works: on a desktop, on iOS or on Android.
1. Inbound: Cloudflare Email Routing
Configuring the inbound side takes literally three minutes.
In the Cloudflare dashboard, under the christianperoni.dev domain, I went to Email > Email Routing, added and verified my IMAP mailbox as a Destination address by clicking the confirmation link that landed in that mailbox, and let Cloudflare create its MX records and the first SPF TXT record on its own. Then I created the first rule, info@christianperoni.dev → Send to an email → my mailbox, repeated it for me@christianperoni.dev, and from that moment anything sent to those addresses lands in the mailbox.
Two things worth knowing before you hit save.
Email Routing is inbound only. It doesn’t send, it doesn’t keep a copy and it has no archive of its own: if the forwarding destination doesn’t exist or rejects the message, that message is gone. Which is why the second piece of the architecture isn’t optional.
Your MX records get replaced. If the domain already had MX records — say, from a provider you were using — Cloudflare swaps them out and that provider stops receiving mail. If yours does, export the rules and any existing messages first.
2. Storage: Which IMAP Mailbox
This is the part I gave the most thought to, because it depends on what you already have and how much you trust the provider.
The good news is that any mailbox offering IMAP with stable credentials works. Gmail, Outlook, an independent provider, your university account: the pattern doesn’t change, only four things do.
- Authentication. Gmail wants an app password (with two-factor enabled) or OAuth2. Outlook.com has disabled basic authentication and requires OAuth2. Most clients support both, but it’s the first practical hurdle: if the client can’t authenticate, the problem is there, not in the architecture.
- Spam filtering on forwarded mail. Forwarding breaks the alignment between the original sender and the delivering server, and some providers treat it with suspicion. That’s exactly why I ruled out the most aggressive consumer providers: a mailbox that filters too hard undoes all the work you did upstream.
- Storage. 1 GB, 15 GB or 1 TB makes a big difference once you enable a catch-all and start receiving spam on addresses that don’t exist.
- Independence. If the provider shuts down or changes its terms, with IMAP you walk away with everything. With a proprietary archive, not so much.
There’s also a detail worth making clear up front: the mailbox provider cannot also be the sending server for your domain. Even if the mailbox is on Gmail or Outlook, sending with From: info@christianperoni.dev through their SMTP would break DMARC alignment, because those servers are authorised to send for gmail.com or outlook.com, not for my domain. That’s where the third piece comes from.
3. Outbound: Mailjet and Domain Authentication
This is the delicate part, because it decides whether your mail ends up in Gmail’s inbox or in spam.
I compared Brevo, SMTP2GO and Mailjet. I picked Mailjet for three reasons: the Free plan allows 6,000 emails per month (200 per day) without a credit card, the company and its servers are in the European Union, and domain authentication with SPF and DKIM works without workarounds.
I signed up for the free plan with my IMAP mailbox, not a throwaway consumer address: accounts created from public domains get limited more often. I added christianperoni.dev as a sender domain, and the Cloudflare integration is automatic, because Mailjet detects that the domain uses its DNS and opens a direct authorisation screen. Once the domain was verified, with green ticks on SPF and DKIM, I generated the Secret Key that goes with the API Key.
Here’s the detail that costs the most time to anyone configuring mail for the first time: two separate SPF records cannot exist on the same domain. Cloudflare had already created one for inbound, Mailjet needed to add its own, and two records together make receiving servers answer with a permerror: the message is dropped or marked as spam even if both were correct on their own. The integration detected the conflict and merged them into a single record.
v=spf1 include:_spf.mx.cloudflare.net include:spf.mailjet.com ~all
At the same time Mailjet added the DKIM public key (mailjet._domainkey) and the ownership verification record. SPF says which servers may send for the domain, DKIM signs the message and lets the recipient verify it wasn’t altered: you need both, aligned with the domain shown in From:.
One last record is missing: DMARC, which tells receiving servers what to do when authentication fails. A minimal one, in monitoring mode, looks like this:
v=DMARC1; p=none; rua=mailto:dmarc@christianperoni.dev; adkim=r; aspf=r
p=none means “do nothing, just send me the reports”: the right way to start, because with quarantine or reject a configuration mistake makes legitimate mail disappear. Reports arrive at the address in rua, and they’re worth opening at least once: they’re boring, but they’re the only way to know whether someone is sending mail as you.
One last note on credentials: the API Key is the SMTP username, the Secret Key is the password. They don’t go into the repository, they don’t go into a screenshot, and they can be regenerated in thirty seconds.
4. The Client: Outgoing Server, Identities and Filters
Since my IMAP mailbox was already set up in my mail client, I didn’t create a new account from scratch: I just added the sending engine and the aliases. Menu names differ from one app to another; the substance doesn’t: you need a client that handles IMAP, a separate outgoing server and multiple identities.
- Outgoing server. In the account settings I added an SMTP server separate from the mailbox one: host
in-v3.mailjet.com, port587, securitySTARTTLS, normal password authentication, API Key as the username and Secret Key as the password. - Identities. In the identity management for the same account I added
info@christianperoni.devandme@christianperoni.dev, both bound to the Mailjet server I had just created. So when I write as the IMAP mailbox I go out through the provider’s server; when I pick@christianperoni.devin the From field, mail leaves through Mailjet. - Filters. In the card view of the unified inbox, mail addressed to the aliases was getting mixed in with everything else. I fixed it with two rules in the message filters: if the To or Cc field contains
info@christianperoni.dev(orme@), the client applies a different coloured tag, which changes the colour of the card’s side bar. Now I recognise them at a glance without moving anything into folders.
It works because the original address stays in the To header even after Cloudflare forwards the message: the filter doesn’t look at where the message came from, it looks at who it was addressed to.
One thing that isn’t obvious: Mailjet only sends, it doesn’t keep a copy. The copy in Sent is written by the client, into a folder of your IMAP account. If you ever switch clients, that folder is the only archive of the mail you’ve sent: worth knowing where it lives, and worth including in your backups.
What I Found Out Afterwards
None of these blocked me, but they’re the things I’d have liked to read beforehand.
- A catch-all is convenient and dangerous. Receiving on any made-up alias is convenient, but it also means accepting spam addressed to addresses that don’t exist. For now I’ve left it off and only create the rules I actually need, keeping an eye on storage.
- The limits, in numbers. Cloudflare: 200 routing rules and 200 destination addresses per account. Mailjet: 6,000 emails per month, 200 per day, no credit card. The daily cap is shared with any other use of the account, so if you ever add a newsletter, the relay is the same and so is the bill.
- Plus-addressing is an ally. If the mailbox provider supports it (
user+something@...), you get infinite aliases without touching Cloudflare or creating identities: handy for services that ask for an email address and that you want to be able to filter. - Cloudflare Email Service doesn’t replace the relay. Cloudflare has shipped outbound sending too, but on the free plan it only delivers to verified destination addresses: fine for project notifications, not for replying to anyone.
p=noneis not a final configuration. After a few weeks of clean reports you move top=quarantine, which is the point where DMARC actually starts protecting the domain. Cloudflare also has DMARC Management, which creates the record and reads the reports for you if you’d rather not open them by hand.- Portability is the real advantage. If the mailbox provider shuts down tomorrow, I change the destination in Cloudflare and download the mail over IMAP: nothing else moves. If I want a different relay, I change SPF and DKIM. Neither operation requires switching anything off.
Conclusions
With less than half an hour of configuration and zero euros spent, I now have professional-grade email on my personal domain.
- Scalable. If tomorrow I want
invoices@christianperoni.devornewsletter@christianperoni.dev, I add a Cloudflare rule and an identity in the client in thirty seconds, without touching DNS or Mailjet. - Reliable. Inbound rests on Cloudflare’s infrastructure, storage on an independent mailbox, outbound on a relay with aligned SPF, DKIM and DMARC.
- Zero maintenance. If I shut down the Gen8 or change my internet provider, mail keeps working without flinching. It’s the only part of my infrastructure that doesn’t depend on my house, and that’s deliberate.
The lesson, though, isn’t which provider to pick. It’s that separating inbound, storage and outbound turns a problem that looks monolithic into three independent decisions, each one reversible. It’s the same reasoning I apply to code: if a piece is replaceable, I’m not afraid of getting the initial choice wrong, because I can change it without redoing everything.
And if the provider you choose runs on donations, as many independent services do, it’s worth supporting it: behind a mailbox that opens in a second there are machines humming somewhere, bills to pay and people who believe in it. Free email outside the commercial circuit exists only as long as someone chooses to pay for it.