Postfix is an open-source Mail Transfer Agent (MTA) used to route and deliver emails on a Linux machine.
Please follow the steps below to install and configure Postfix on Ubuntu 18.04.
Before proceeding with the steps, you must ensure that you are using a Fully Qualified Domain Name (FQDN) as your Ubuntu 18.04 server's hostname.
Also, the MX record needs to point to your email server if you want to receive the emails in Postfix.
It is easy to install Postfix because it is included in the default repositories of Postfix.
1. First, we will update the apt package and run this command –
sudo apt update
sudo apt-get install postfix
2. In the installation setup, select the internet site for the mail configuration and enter the domain name for your email server.
3. Enter the root and postmaster email addresses.
This email address uses for the primary account.
Other destinations to accept mail.
- In this, we can mention other domains.
Postfix can receive emails for the mentioned domain; you can enter your other domains. If you don't want to enter any other domain, you can keep the default value and click on the OK button.
- We will set No in the option below as we use the journaled filesystem.
- At the Local Network, keep the default settings and click on the OK button.
- Enter the Mail Box size limit.
Setting the option to 0 will mean there is no restriction on the mailbox size limit.
- Choose the character for the local address extension (if required), and click on the OK button.
- Select all the internet protocols.
Once you click on it, the installation process will begin.
7. After completing the process, check for the service; it should be Active.
service postfix status
8. Now, test the Postfix server using Telnet.
telnet 127.0.0.1 25
Connected to 127.0.0.1.
Escape character is '^]'.
220 demovpstest.com ESMTP Postfix (Ubuntu)