It is the simple mail transfer agent which is frequently used for mail exchange service in Linux machines. Due to having use of directory it is quite easy for all administrators to handle it. Postfix has built-in many layers of security.
-> Main.cf file located in /etc/postfix/main.cf need to be edited.
-> Mail box which we are going to include in main.cf file will receive all the mails.
First, we need to install postfix by following command.#yum install -y postfix
Go to /etc/postfix folder and edit main.cf file with your desire editor.
Here are few changes which need to be done in that file.
Host which will be sending mail
Host will be set to sending host.
Mails will be delivered in this folder.
Network path has to be set as per your need.
Set interface to read all of the incoming mails coming to home mailbox directory.
main.cf File Configuration
|main.cf File Configuration|
After the editing of main.cf file we need to create two users in the server to send and receive the mail. To create user and to add password commands are showing below.
|Adding Usernames and Passwords|
Scenario : Here We will send mail from postfix_test1 user to postfix_test2 user through NetCat. If you do not have net cat installed in your system, then install it through following command.
#yum instll -y nc
This command will download and install nc in your CentOS server.
Sending mail from postfix_test1 to postfix_test2 user.
Now we will be checking this mail by going into postfix_test2 user account which will be lying into home folder.
Location : /home/postfix_test2
Now we will send one mail from firstname.lastname@example.org to email@example.com using Outlook Express in client machine windows XP. But before that we need to configure firstname.lastname@example.org email account to outlook express so that it can be able to send mail to email@example.com Here is the firstname.lastname@example.org email’s configuration part in outlook.
If you are facing connection problem or any kind of configuration problem, then you need to check below things:
-> Check you DHCP server is running and assigning IP to client XP machine. (Highly Recommended)
->Your postfix server should be restarted after outlook configuration.
-> Make sure your dovecot(IMAP) service should be run.
We need to set certain things to work outlook without any errors.
->Mail Account : mail.chintangurjar.com
->Name : Postfix Test 2 ( You can give any name here)
->E-Mail Address : email@example.com
Below figure shows the configuration part of above three things. We can go to Tools-> account and then We need to click on add to bring this dialog box properties.
After this we need to set properties for our servers which incoming outgoing server we are going to use and the credentials of user lying into the server.
-> My Incoming mail server : POP3
->Incoming mail (POP3): Your Default Gateway
-> Outgoing Mail (SMTP): Your Default Gateway
->Account Name: your server userid
->Password : your user’s password
Below figure shows the configuration part of server of my demonstration.
Once you have done this, click on Send and Receive all or press ctrl+m. Outlook will be connect to the server machine and will open the email account of firstname.lastname@example.org within it. Sending mail from email@example.com to firstname.lastname@example.org.
Now we will check this mail in our CentOS server. For that we need to go to the /home/postfix_test1/chintan_inbox/new folder as we have done this previously. It will give us a mail with its header. Header contains so much information about mail such as from which ID it came, on which date and time, To whom it was delivered and what was the return path etc.
Thus whole postfix task can be accomplished. Now we will move forward to our last part which is openvpn.