Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security, Veeam & DevOps

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form

How to Install and Configure Postfix as a Send-Only SMTP Server

Posted on 21/11/202117/08/2026 Raphael Gab-Momoh By Raphael Gab-Momoh 1 Comment on How to Install and Configure Postfix as a Send-Only SMTP Server
  1. Home
  2. Linux
  3. How to Install and Configure Postfix as a Send-Only SMTP Server
posfix-as-an-smtp-server

Postfix is an open-source mail server released under IBM in 1998. Furthermore, it helps to route traffic between various mail servers across the internet. It is still in use because Postfix strives to be fast, uncomplicated, and trustworthy. To run a mail-in Linux, we need to understand servers’ separate roles in an email configuration. The most important role of emails is what we call a null client. This article explains how to install and configure Postfix as a Send-Only SMTP Server. Please see How to add or remove email addresses from a mailbox.

Please refer to the following guides for information: How to locate directory file context and restore it with SELinux, and How to Restore Deleted Azure App Service Using PowerShell.

A null client is a mail server that is running in SMTP process

SMTP is a simple mail transfer protocol. Every Linux server runs SMTP processes to send mail to the outside.

A forwarder configures Null clients. In addition, the mail forwarder is a server that sits somewhere, sending emails to the rest of the world. Concisely, we will call the Null client an SMTP server.

Also, there is an email role where users can receive emails via a server known as an IMAP/POP server. It listens for all incoming messages on port 25. Null Clients do not receive messages from the outside world. Thus, null clients are just for sending messages to the internet.

Steps to Install and Configure Postfix

The following steps explain the installation and configuration of Postfix. Please see How to Install and Configure Nagios on Ubuntu, and Configure WSUS Email Notification for Office365.

Installing Postfix on RHEL

To install and configure Postfix as a send-only SMTP server, execute the following command,

#dnf install postfix
postfix-installed-1

It has been installed, so let’s start it

#Postfix start
How to Install and Configure Postfix as a Send-Only SMTP Server-postfix-start

Configure Postfix On Centos

Postfix came out of the box with a null client configuration installed on Centos and started automatically because you need Postfix for processes that need to send out information online. So, the next thing to do is check the status using the below command. We shall be using Centos for the configuration.

#systemctl status postfix
status-postfix-1

Configuring Postfix

After you’ve installed Postfix, the next thing to do is to configure it. The configuration file for Postfix can be found at:

#cd /etc/postfix
#ls

The config file we need to edit is the main .cf file

How to Install and Configure Postfix as a Send-Only SMTP Server-main.cf_
.cf

When we are in the /etc/postfix directory, run ls to see all the files and choose main.cf; the next step would be to edit the main.cf file. The file has a lot of parameters, and we can change them to suit what we want the Postfix mail server to do.

vim main.cf

One such parameter that we can change is inet_interfaces. In the config file, inet _interfaces are set to localhost, meaning that the Postfix servers won’t accept incoming messages. So, we need to fix that by replacing the local host with the IP address device.

How to Install and Configure Postfix as a Send-Only SMTP Server- inet
Inet interfaces

To configure Postfix, let’s verify that the default configuration does not allow messages from the outside into the server with the command

#netstat -tulpen
How to Install and Configure Postfix as a Send-Only SMTP Server-netstattulpen
netstat -tulpen

We see that the inode is bound to the local host and not accessible from the outside.

Relay Messages

Another parameter in the main.cf is the relayhost. If we want our postfix server to relay messages (forward messages) to another host, we need to change it there.

relayhost
relay host

So, we just need to add the name or IP address of the forward or relay host. It is a widespread practice to put the IP address or name in square brackets, as shown above so that the postfix server will not do a DNS/MX mail lookup as it will just send the messages directly to the relay host.

Before we put any IP address, we must ensure the owner has given their consent because, by default, nobody would want to be used as a reply host and become a” dumping ground” for unwanted messages. To ensure the change takes place, we must run the command below so that the change is persistent.

# systemctl restart postfix

The following commands can start, stop, and restart the mail system. Please remember that the following commands are only available to the superuser, which implies you must be root to use them.

 Important Commands

To install and configure Postfix, ensure you note the following commands:

Objective: Stop Postfix

To stop postfix use:

# Postfix stop

Objective: Start Postfix

To start postfix use:

#Postfix start

Objective: Restart Postfix

To reload Postfix, use:

#Postfix restart

Objective: Reload postfix

To reload the config files, use the following:

#postfix reload

Objective: Postfix status

To check the status of Postfix:

#Systemctl status postfix

Distro specific Start-stop commands

Debian Centos/RHEL/Fedora
$ sudo service postfix start
$ sudo service postfix stop
$ sudo service postfix restart
# /sbin/service postfix start
# /sbin/service postfix stop
# /sbin/service postfix restart

Summary

In conclusion, Postfix is an open-source mail server with its config file called main.cf located at /etc/Postfix.

To be able to forward messages, we need to change the configuration of the relay host in the config file with the IP address or name of the relay host we want to send the messages. Guess you have a clear understanding of how to install and configure Postfix as a send-only SMTP server.

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
Linux

Post navigation

Previous Post: How to Improve Website Response Using Traffic Manager
Next Post: Docker Engine Installation on Ubuntu

Related Posts

  • Screenshot 2020 05 14 at 17.47.09
    Configure OpenSSH Server: A Quick Guide Linux
  • openstack ola
    Openstack Deployment with Devstack Linux
  • dsdfg
    Create a Bootable USB Drive Using dd Command on Linux Linux
  • SUBVERSION FEATURE
    How to Install Apache Subversion on a Linux System Linux
  • PRIVATE DOCKER REGISTRY
    How to Set up Private Docker Registry Containers
  • image 36
    Keepalive Settings: Understanding keepalive configuration Linux

More Related Articles

Screenshot 2020 06 30 at 18.04.49 How to install and configure Jitsi video conferencing server on Ubuntu Linux
517443 637286201540125528 16x9 1 User account and process management in Linux Linux
systemd services How to use Systemd Timers on Linux Linux
HOW TO AUTOMATE A PROCESS IN LINUX@ Shell Scripting: How to Automate a Process in Linux Linux
Docker Volumes Create and Mount Volume to Docker Container Containers
sshfs Mounting remote directory using sshfs Linux

Comment (1) on “How to Install and Configure Postfix as a Send-Only SMTP Server”

  1. Avatar photo m101p says:
    21/11/2021 at 5:45 PM

    Very nice

    Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

vexpert-badge-stars-5

Virtual Background

VEEAMLEGEND

Categories

Top 30 Sysadmin blog

veeaam100

Veeam Vanguard

  • Old Right click Context Menu
    How to Restore Old Right-click Context Menu in Windows 11 Windows
  • Featured image Desktop Stickers
    How to create Desktop Stickers in Windows 11 Windows
  • Migrate from SQL Database
    Migrate Veeam One Database from SQL Server 2017 to 2025 Backup
  • PersonalHow to Create Symbolic Links in Linux
    All You Need to Know About Symbolic Links in Linux Linux
  • header picture 1
    Azure CI/CD: Configuring Email Notifications in Azure DevOps AWS/Azure/OpenShift
  • Screenshot 2020 12 06 at 17.01.38
    Start Print Spooler Service: How to fix Print Spooler Service not running Windows
  • wsus logo e1653651564255
    How to configure Windows server update services Windows Server
  • banner
    How to install and configure FSRM in Microsoft Windows Server Windows Server

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,746 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Contact
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon
  • Bsky

Tags

Active Directory Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2026 TechDirectArchive

Loading Comments...

You must be logged in to post a comment.