Docs / Email Servers / Configuring Postfix as a Send-Only Mail Server

Configuring Postfix as a Send-Only Mail Server

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 209 views · 1 min read

Why Send-Only?

A send-only mail server handles outgoing email (password resets, notifications, alerts) without receiving mail. This is simpler and more secure than a full mail server.

Installation

sudo apt update && sudo apt install -y postfix mailutils

During installation, select Internet Site and enter your domain name.

Configuration

Edit /etc/postfix/main.cf:

myhostname = mail.example.com
mydomain = example.com
myorigin = $mydomain
mydestination = localhost
inet_interfaces = loopback-only
relayhost =

# TLS settings
smtpd_tls_cert_file = /etc/letsencrypt/live/mail.example.com/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mail.example.com/privkey.pem
smtp_tls_security_level = may
sudo systemctl restart postfix

Test Sending

echo "Test email body" | mail -s "Test Subject" user@gmail.com

DNS Records Required

  1. A record: mail.example.com → your-server-ip
  2. MX record: example.com → mail.example.com (priority 10)
  3. SPF record: v=spf1 ip4:your-server-ip -all
  4. PTR record: your-server-ip → mail.example.com (contact your hosting provider)

Check Deliverability

# Check mail queue
postqueue -p

# View mail log
tail -f /var/log/mail.log

Common Issues

  • Email going to spam — ensure SPF, DKIM, and DMARC are configured
  • Connection refused — check if port 25 is blocked by your provider
  • Relay denied — verify inet_interfaces and mynetworks settings

Was this article helpful?