Mail server setup notes
Published
-
Postfix
smtpd_tls_security_level = mayfor inbound MX.- Don’t over-restrict TLS ciphers
postscreenon port 25/465/587.smtpd_miltersorsmtpd_proxy_filterintegration with Rspamd.- Dovecot SASL for ports 465/587.
- DANE for outbound:
smtp_tls_security_level = dane, with local validating DNS resolver.
-
Dovecot
- Mail storage:
mdboxormaildir; I’d pickmaildirfor simplicity unless you want Dovecot-native features. - LMTP delivery from Postfix to Dovecot.
- Sieve via Pigeonhole.
- Disable plaintext auth except over TLS.
- Mail storage:
-
Rspamd
- DKIM signing.
- SPF, DKIM, DMARC validation.
- ARC if forwarding/list behavior matters.
- Redis-backed Bayes/reputation/rate limits.
- ClamAV integration.
- Greylisting cautiously; don’t make your server annoying.
-
DNS
- SPF record.
- DKIM selector records.
- DMARC record, initially
p=none, then move toquarantine/reject. - MX, A/AAAA, PTR/rDNS, HELO name all aligned.
- DNSSEC signed zone.
- TLSA records for DANE.
- MTA-STS TXT + HTTPS policy.
- TLS-RPT reporting.
Important do’s and don’ts
For a serious self-hosted MTA:
- Keep full Postfix logs.
- Log queue ID, remote MX, SMTP response, TLS used.
- Implement SPF/DKIM/DMARC perfectly.
- Align HELO, PTR, MX, A/AAAA.
- Sign with DKIM consistently.
- Avoid shared/bad-reputation IP ranges.
- Warm up volume slowly.
- Monitor Google Postmaster Tools.
- Use Microsoft SNDS/JMRP if applicable.
- Monitor DMARC aggregate reports.
- Publish
postmaster@andabuse@. - Avoid sending bulk/marketing from the same IP as human/transactional mail.
How spam / ham training would work
E-mail client moves message to Junk ↓ Dovecot IMAP sees the move ↓ IMAPSieve triggers script/rule ↓ script calls rspamc learn_spam