When a server needs to be configured, it is important for the system administrator to create a mail server. Postfix is a competent and a feature-rich mail server. It is considered as an easiest one to set up a mail server and a reliable one. Now, through this article let us see the ways to install and configure.


Installing postfix mail server is simple. The following steps will explain the ways to install it.

  • Open the terminal window, if GUI is not used, then log in to the system
  • Provide the following command

       sudo apt-get install postfix

When the installation is over, you can test to check whether postfix server is installed or not by using the following command.

    telnetlocalhost 25

The following information will be displayed on the screen.

Connected to <>
Escape character is '^]'.
220 localhost.localdomain ESMTP Postfix (Ubuntu)

The Postfix mail server has the following main configuration file


This file is the location where you will do a bulk of configuration. Open the file up in your text editor and look for the following section:

myhostname = 
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = 
relayhost =
mynetworks = 
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

This part of configuration must be focused on. The sections that you need to configure are:

myhostname: refers to the hostname of your machine.

If your machine hostname is mail.abcd.com, you will have to use abcd.

mydestination: refers to which destinations the machine will deliver locally. By default it is

      mydestination = $myhostnamelocalhost.$mydomainlocalhost

mynetworks: refers to the legal destinations that mail can be transmitted from. The mynetworks entry that looks like:

      mynetworks = or mynetworks =

mydomain = mydomain.com

Here mydomain will be replaced with your real domain.

After configuring, save the file and restart the mail server by making use of the command:

      sudo /etc/init.d/postfix reload

Your mail server will be ready to run.


Unlike other mail servers, mail server management by using a postfix mail server is simple and also easy to administer and troubleshoot. /p>

Leave a Reply

Your email address will not be published. Required fields are marked *