In this guide we’ll look at how you can configure Postfix MTA as a send-only SMTP server on Debian 10 (Buster), meaning it doesn’t receive and process emails. Its job is only to act as Local mail transfer agent. Postfix is a popular open source Mail Transfer Agent (MTA) used in Linux and Unix environments.

A send only mail server is useful especially when used in scripting, e.g having a cron job that sends an email about the status of its execution, or an application that sends an email to you when certain events happen.

Configure Postfix as a Send-Only SMTP Server on Debian 10 (Buster)

Installing and configuring Postfix as a Send-Only SMTP Server on Debian 10 (Buster) is an easy process. Start by updating your system

sudo apt update

Also set a hostname for the server so that emails will show a from address with valid domain section.

sudo hostnamectl set-hostname --static

Install mailutils package other mail utilities.

sudo apt install mailutils

Finally install postfix:

sudo apt install postfix

As the package installs, you’ll be asked to select an option on screen for your mail server. For “General type of email configuration” window, select Internet site and click OK button

install postfix debian 10 01

The next page will ask you to set your Mail server name, this can be domain or server hostname with an A record.

install postfix debian 10 02

Select OK to save the settings and finish the installation.

Configure Postfix MTA Server

Edit Postfix configuration file /etc/postfix/ to ensure it is configured as send only ( Only relaying emails from the local server).

Set Postfix to listen on the interface. The default setting is to listen on all interfaces.

inet_interfaces = loopback-only

Also, set myhostname to your Server FQDN

Restart Postfix service for it to pick the new changes,

sudo systemctl restart postfix

You have successfully installed and configured Postfix as a Send only MTA server on Debian 10 (Buster). To test email delivery, use the mail command like below

echo "Postfix Send-Only Server" | mail -s "Postfix Testing" [email protected]

You can also load existing data to mail

mail -s "Mail Subject" [email protected] < /home/jmutai/file.txt

This will send an email with the content loaded from /home/jmutai/file.txt in the message section.

Other Postfix related guides:

Postfix Commands Administration Cheat Sheet

Installing postfix3 on CentOS 7

How to get Postfix Mail Statistics from Logs

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here