Wednesday, November 23, 2016

How To Install and Configure a Postfix Mail Server On Linux


This informative article is related to installation and configuration of postfix Mail Server. First of all, your mind will click, what is email server.



How To Install and Configure a Postfix Mail Server On Linux




Email Server:

An e-mail server is a computer in your network which act as your virtual post office. A mail server is like memory which store e-mail. It is a database of user accounts that the mail server identify and will deal with locally, and communications modules.

Features of Postfix Mail Server On Linux:

You have many choices to install a Mail Server like on Outlook,Linux etc.In this article you will learn about installation of mail server on Liux.Why linux is my choice.There are number of reasons which are given below.
  • More efficient mail solution
  • Expand repertoire of Linux skills
  • User friendly environment
  • Support 1-300 environments

Requirements:

In order to install Postfix mail server on Linux, you have to require following below.
1). install Postfix on an Ubuntu Server(10.04 OR 9.10)
2). Fake Domain
Domain must be FQDN.I will use the fake domain mail.mymail.com.

How To Install Postfix Mail Server:

The method which is I am going to share with you is too much simple.No complexity is involved.Just you have to follow given below steps.

1) Open up a terminal window or log in if you are using GUI-less server.
2) Enter the command sudo apt-get install postfix.
3) The installation will also automatically start the Postfix daemon for you.
4) Enter Command " telnet localhost 25" to make sure you can connect to your Postfix server
5) Something like below text will appear.

Trying 127.0.0.1...
Connected to www.mymail.com.
Escape character is '^]'.
220 localhost.localdomain ESMTP Postfix (Ubuntu)
6) To make sure that you are connected with domain enter below command. 

telnet www.mymail.com 25

7)Now it is time to start configuration as you have finished installation process.Follow below steps to configure postfix mail server on Linux.

How configure postfix mail server on Linux:
Follow below steps to configure postfix mail server on Linux.

Open configuration file: 

Postfix mail server has one main configuration file /etc/postfix/main.cf. In this file you can do many configurations. Open this file up in text editor like Nano.
Configuration section:

Below configuration section will appear when you will open the file.

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

Editing in configuration file:


Some editing is needed in configuration file as have mentioned below procedure.

myhostname:
This is the hostname of your machine. Do not enter full name like If your machine hostname is mail.mydomain.com you will only use mydomain.

mydestination:

mydestination specify that which destination will be deliver locally by machine.The default is:

mydestination = $myhostname localhost.$mydomain localhost

mynetworks:
mynetworks define destinations that mail can be relayed from. You have to enter any networks entry as given below

mynetworks = 127.0.0.1/8

The above entry is secure and defines local machines only.

mynetworks = 127.0.0.1/8 192.168.100.1/24

The above entry would authorize local machines and your internal network addresses
Above two mention entries can cause error as dhcp addresses change constantly To avoid error enter given below network entry. Because of this I have used the following, specialized entry which will avoid this issue:

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128

If your mail server serves up mail to your entire domain, then enter below entery.

mydomain = mydomain.com

Replace mydomain.com with your real domain.
Restart mail server
Save the configuration file and restart your mail server by entering below command.
sudo /etc/init.d/postfix reloadThat's it.you have done. Your mail server will running.

Users:

You should have a user name which is compatible with every email address you need. If your server has a GUI you can just use the GUI tool for this. If your server is a GUI-less server then follow below command for username:

                                    sudo useradd -m USERNAME

USERNAME is the real name of the user.

Password:

Enter password twice by given below command.

                                         sudo passwd USERNAME
USERNAME is real name of user.

Test Your Server:

Now its time to check the server. Send an email to your newly created server.To check eitehr email has send log in and use the Alpine command line email reader.For this you have to install sudo apt-get install alpine.
Above method which I have shared with you,show that its too much easy to Setting up a mail server .If you have liked this post and have nay problem then share with us.