100% Inbox Delivery

HomeBlog › How to Postfix relay smtp

How to Postfix relay smtp

Published October 12, 2024 · Updated July 22, 2026 · Guides & Tutorials

Postfix is the most popular mail server on Linux, and one of its most useful roles is as a relay — a "null client" that hands all outbound mail to a trusted smart host instead of delivering it itself. This is the reliable way to make a server's email actually arrive. Here is how to configure a Postfix relay.

Why run Postfix as a relay

A server sending mail directly usually fails: no reputation, filtered ports, blocked IPs. Configuring Postfix to relay through an authenticated smart host gives every application on the box trusted, authenticated delivery through one clean IP.

Postfix relay configuration

  1. In /etc/postfix/main.cf, set relayhost = [smtp-host]:587.
  2. Enable SASL: smtp_sasl_auth_enable = yes and point smtp_sasl_password_maps at your credentials file.
  3. Enable TLS: smtp_tls_security_level = encrypt.
  4. Run postmap on the password file, then systemctl reload postfix.
  5. Test with echo | mail -s test [email protected].
Lock it down: chmod 600 your SASL password file and restrict which local networks can inject mail (mynetworks). An unrestricted Postfix is an open relay waiting to be abused.
Related reading: Godaddy smtp relay · Smtp restrictions cpanel · free email tools
The smart host Postfix needs

Relay Postfix through a dedicated SMTP

Dedicated IP, port 587, and SPF/DKIM/DMARC ready — the trusted smart host for your Postfix relay. From $39.99/mo.

See how it works →View pricing

Frequently asked questions

How do I configure Postfix as a relay?

Set relayhost to your smart host on port 587, enable SASL authentication and TLS, run postmap on the password file, and reload Postfix.

What is a Postfix null client?

A Postfix setup that sends all outbound mail to a smart host and accepts no local delivery — ideal for app servers that only need to send.

What smart host should Postfix use?

A dedicated SMTP with its own IP and full authentication, so your relayed mail is trusted and delivered.