Bottom line: Inbound mail is easy; landing in the inbox is a six-item checklist that most self-hosters skip. SPF, DKIM, DMARC, rDNS, a static IP with no bad history and a warm-up schedule decide it — the software is the least of it.

The checklist

Item Record
SPF v=spf1 mx -all in TXT
DKIM selector in TXT, signing enabled
DMARC v=DMARC1; p=quarantine; rua=mailto:...
rDNS PTR matching the A record
HELO matching the hostname
MTA-STS optional, raises trust

All six, or expect spam folder.

SPF

A single record, -all as hard fail. Multiple SPF records break lookup and count as “none”. Keep under 10 DNS lookups.

DKIM

2048-bit, rotated yearly, selector published as TXT for as long as the key is live:

1
2
opendkim-genkey -b 2048 -s mail -d example.com
cat mail.txt # publish, keep mail.private

DMARC

Start at p=none with a rua address, read the aggregate reports for two weeks, fix what fails, then move to quarantine, then reject. Starting at reject before reading reports aligns you with whatever the reports say is already broken.

The IP problem

A residential IP is heavily penalised and often blocked outright on port 25 by the ISP. A cheap VPS with a clean, dedicated IPv4 is the right base. Check the IP against the Spamhaus blocklist before buying and again monthly.

Warm-up

Week 1: 20 messages a day. Week 2: 100. Week 3: 500. Sudden volume from a new IP is the most common reason a technically perfect setup lands in spam for a month.

Monitoring

Postfix rate limits, pflogsumm daily, and a DMARC aggregate parser. Alert when rejections exceed 2% — it precedes a reputation collapse by days.

The honest cost

Three to five hours setup and about 20 minutes a month. If that is unappealing, a mail relay or a hosted mailbox with a custom domain gets 90% of the result for the same money.

Operating notes

Inbound mail is easy; the six-item inbox checklist decides everything and most self-hosters skip all six.

1
SPF -all · DKIM 2048 · DMARC p=none→quarantine→reject · rDNS · matching HELO · MTA-STS

DMARC staging

Start at p=none with a rua address, read aggregate reports for two weeks, fix what fails, then step to quarantine. Starting at reject aligns you with whatever is already broken.

The IP

A residential IP is penalised and often blocked on port 25. A cheap VPS with clean dedicated IPv4; check the Spamhaus list before buying and monthly after.

Warm-up

20 messages a day, then 100, then 500 across three weeks. Sudden volume from a new IP is the top reason a perfect setup lands in spam for a month.

FAQ

What is the SPF record for a mail server?

Publish a single SPF record as v=spf1 mx -all in TXT, using -all as a hard fail. Multiple SPF records break lookup and count as “none”. Keep the record under 10 DNS lookups.

Why does my mail land in spam when my setup is technically correct?

Sudden volume from a new IP is the most common reason a technically perfect setup lands in spam for a month. Follow the warm-up schedule: 20 messages a day in week one, 100 in week two, 500 in week three.

Should I start DMARC at p=reject?

No. Start at p=none with a rua address, read the aggregate reports for two weeks, fix what fails, then move to quarantine, then reject. Starting at reject before reading reports aligns you with whatever the reports say is already broken.

Can I run a mail server on a residential IP?

A residential IP is heavily penalised and often blocked outright on port 25 by the ISP. Use a cheap VPS with a clean, dedicated IPv4 instead. Check the IP against the Spamhaus blocklist before buying and again monthly.

How long does it take to set up and maintain a mail server?

Setup takes three to five hours, and ongoing maintenance is about 20 minutes a month. If that is unappealing, a mail relay or a hosted mailbox with a custom domain gets 90% of the result for the same money.