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

Setting Up Postfix as a Send-Only Mail Server

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

Introduction

Many applications need to send email (notifications, password resets, alerts) but don't need to receive mail. A send-only Postfix configuration is lightweight and straightforward.

Installation

sudo apt update
sudo apt install -y postfix mailutils

During installation, select Internet Site and enter your server's FQDN (e.g., server.example.com).

Configure Send-Only Mode

Edit /etc/postfix/main.cf:

myhostname = server.example.com
mydomain = example.com
myorigin = $mydomain
inet_interfaces = loopback-only
mydestination = $myhostname, localhost.$mydomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::1]/128

Restart Postfix

sudo systemctl restart postfix

Test Sending

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

Set Up DNS Records

For deliverability, ensure you have:

  • SPF record: v=spf1 a mx ip4:YOUR_IP ~all
  • PTR record: reverse DNS matching your hostname
  • A record: hostname pointing to your server IP

Viewing the Mail Queue

# Show queued messages
mailq

# Flush the queue
sudo postfix flush

# Delete all queued messages
sudo postsuper -d ALL

Was this article helpful?