How To Install Postfix From Source

By on November 29th, 2016

In this tutorial, we can check how to install Postfix from source.

Postfix is a free and open-source Mail Transfer Agent(MTA) that routes and delivers Emails. It is the most popular alternative for the widely used Send mail MTA. A Mail Transfer Agent is any software that transfers Emails from one computer to another. The Mail Transfer Agent uses client-server application architecture to transfer. Emails. Send mail is the MTA used in RedHat Enterprise Linux by default. Client-Server architecture is a network architecture in which each system or a process on the network is either a client or server. Clients are PCs/workstations on which users run applications. Servers are powerful computers/processes dedicated to managing drives or network traffic.


Package Information

Download from here :

Compressed size : 3.9M

Extracted size : 25M


Postfix dependencies

Install all dependencies to avoid error while running make command. You can install all the dependencies using yum package manager.

yum install db*-devel

You must have a gcc compiler installed in your server before installing the postfix.

yum install gcc -y


Installation of Postfix

step 1

Change the current working directory to /usr/src/

# cd /usr/src/

step 2

Download postfix source code from the link below.

step 3

Extract the downloaded tar.gz file using tar.

# tar -zxvf postfix-2.11.8.tar.gz

step 4

Change the current working directory to postfix source file.

# cd postfix-2.11.8

step 5

Before you compile the program, you need to create user and group for postfix.

# groupadd postfix

# groupadd postdrop

# useradd postfix -g postfix -s /bin/false

Create a user account “postfix” with a user id and group id that are not used by any other user account. Preferably, this is an account that no-one can log into. The account does not need an executable login shell, and needs no existing home directory. The password and group file entries look like this:





Note: there should be no whitespace before “postfix:”.

Create a group “postdrop” with a group id that is not used by any other user account. Not even by the postfix user account. The group file entry looks like:



Note: there should be no whitespace before “postdrop:”.

step 6

Run make command to compile the postfix

# make


After completing the compilation run make install command to install postfix from source. Postfix will show a warning message explaining that this installation will replace existing send mail or postfix programs. You will be prompted to give prefix locations for the installed file names. This feature enables the user to customize the locations for installed files. You can either press enter for using the prefixed values or customize them.

# make install

step 8

Start postfix mail server

# /usr/sbin/postfix start

step 9

Postfix will be listening to port 25 and can be seen by running netstat command. The netstat command will show all the active services in the server.

# netstat -plantu | grep 25


If you need any further assistance please contact our support department.



Leave a Reply