GICT knowledge base
How To Install Postfix From Source
Published
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 : http://www.postfix.org/download.html
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.
http://www.postfix.org/download.html
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:
/etc/passwd:
postfix:*:12345:12345:postfix:/no/where:/no/shell
/etc/group:
postfix:*:12345:
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:
/etc/group:
postdrop:*:54321:
Note: there should be no whitespace before “postdrop:”.
step 6
Run make command to compile the postfix
# make
step7
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.
Related guides
How to Test Application Emails with Mailpit
Capture staging emails with Mailpit over a private connection. Inspect message formats and attachments without confusing capture with real delivery.
EmailHow to Test SMTP Login and TLS with swaks
Diagnose SMTP connectivity, TLS and authentication with swaks. Protect credentials and distinguish server acceptance from recipient delivery.
EmailResolving: This message was classified as rSPAM and may not be delivered
Resolve InterServer rSPAM rejections using the SMTP code and MailBaby rule details. Check authentication, security and false positives through support.
EmailHow to Check SPF, DKIM and DMARC Using Message Evidence
Diagnose email authentication using real message identities and selectors, DNS answers and alignment instead of guessed records or delivery assumptions.
