What are the key configuration settings for an MTA (e.g., Postfix, Exim)?
Still have a question, spotted an error, or have a better explanation or a source we should cite?
If you're running your own Mail Transfer Agent rather than using a hosted ESP, the configuration decisions you make at setup time have long-term deliverability consequences. Here's what actually matters.
Hostname and DNS configuration (don't skip this). Your MTA's hostname needs to resolve forward and backward. Forward: the domain name resolves to your IP. Reverse (PTR): your IP resolves back to the domain name. A missing or mismatched PTR record is a common cause of deliverability problems and is frequently checked by receiving servers. Set this first before anything else.
Network and relay settings. In Postfix, the mynetworks parameter defines which IPs can relay mail through your server. Get this wrong and you've created an open relay. A server that will forward email for anyone, which gets your IP listed on blocklists within hours. Restrict it to your own infrastructure only.
Authentication (SASL) for outbound sending. If any of your applications need to authenticate to your MTA to send email, you need SASL configured. Without it, your applications either need to be in mynetworks (only safe for trusted servers on the same network) or they can't send at all.
TLS for encryption in transit. Configure TLS so connections to and from your server are encrypted. Opportunistic TLS (smtp_tls_security_level = may) encrypts when possible without breaking delivery. Mandatory TLS will fail delivery to servers that don't support it. Generally not what you want.
Queue management and rate limiting. Set per-domain connection limits and delivery rate limits. Sending too fast to a single mailbox provider triggers throttling and can damage reputation. Most providers document their rate limits. Respect them.
After configuring, verify your SPF record authorizes your sending IP and your DKIM keys are correctly published. Our free SPF checker and DKIM lookup tool cover both.
Contributors
Who worked on this answer
Every name links to their profile. Every company links to their site. Real people, real accountability.