Postfix relay for Linux servers

Have apps, cron jobs or monitoring tools that send with sendmail or to localhost:25? Configure Postfix to relay everything through Signally. Nothing in the apps needs to change.

1. Install Postfix and SASL support

Debian / Ubuntu
sudo apt install postfix libsasl2-modules
# Choose "Satellite system" (or "Internet Site" and edit main.cf as below)

On RHEL, Rocky or Alma Linux: sudo dnf install postfix cyrus-sasl-plain.

2. Add your SMTP login

/etc/postfix/sasl_passwd
[smtp.signally.cloud]:587 smtp-12-ab3xk9:your-smtp-password
Terminal
sudo chmod 600 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd

3. Point Postfix at Signally

/etc/postfix/main.cf (add or change)
relayhost = [smtp.signally.cloud]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

# Accept mail from this machine only
inet_interfaces = loopback-only
mydestination =

On RHEL-family systems the CA bundle is /etc/pki/tls/certs/ca-bundle.crt.

4. Send from your verified domain

Signally only relays mail whose sender is on a verified domain. Cron and system mail is usually sent as root@your-hostname, so rewrite it:

/etc/postfix/sender_canonical
/.+/    [email protected]
/etc/postfix/main.cf (add)
sender_canonical_maps = regexp:/etc/postfix/sender_canonical

This rewrites both the envelope sender and the From header. If you only want to rewrite some senders, list them one per line instead of the catch-all.

5. Reload and test

Terminal
sudo systemctl reload postfix
echo "Relay test from $(hostname)" | mail -s "Postfix relay test" [email protected]
sudo tail -f /var/log/mail.log      # or: journalctl -u postfix -f

A line with relay=smtp.signally.cloud and status=sent (250 …) means Signally accepted it. 535 means the login is wrong; sender_not_verified means a sender was not rewritten to your verified domain.

Port 587 with STARTTLS is used because Postfix supports it everywhere. If your network blocks 587, use relayhost = [smtp.signally.cloud]:465 together with smtp_tls_wrappermode = yes (Postfix 3.0 and later), and change the port in sasl_passwd to match.

Stuck? Email [email protected] with your account name and the message ID or error code.