How To Install Mail Server With PostfixAdmin on CentOS 7

r00t May 17, 2017

Install Mail Server With PostfixAdmin on CentOS 7

In this tutorial we will show you how to install and configuration of Mail Server With PostfixAdmin on CentOS 7 server. For those of you who didn’t know, Postfixadmin is a web frontend to the mysql or mariaDB database used by Postfix. With Postfixadmin we can easily manage from a web browser our Postfix service, adding and removing mail users and domains, mail aliases, disk quotas, etc.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Seafile Secure Cloud Storage on a CentOS 7 server.

Install Mail Server With PostfixAdmin on CentOS 7

Step 1. First, let’s start by ensuring your system is up-to-date.

Step 2. Install LAMP server.

A CentOS 7 LAMP stack server is required. If you do not have a LAMP installed, you can follow our guide here. Also install required PHP modules:

Step 3. Configuring MariaDB for PostfixAdmin.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. You should read and below each step carefully which will set the root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

Configure it like this:

Next we will need to log in to the MariaDB console and create a database for the PostfixAdmin. Run the following command:

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for PostfixAdmin installation:

Step 4. Installing PostfixAdmin.

The first thing to do is to go to PostfixAdmin’s download page and download the latest stable version of PostfixAdmin:

Open the mail configuration file:

Edit the following values:

Now you need to assign the ownership of the files and folders to Apache’s user and group. To do so, the command is:

To populate the database go to https://Your_IP_Address/postfixadmin-3.0.2/setup.php and you should see something like below:

Create a new admin user:

Step 5. Installing and configure Postfix.

Install postfix with the following command:

Once the installation is completed, we need to create configuration files:

Edit the following values:

Edit the following values:

Edit the following values:

Edit the following values:

Edit the following values:

Edit the following values:

Edit the following values:

Next, edit the main.cf file:

Open the master.cf file, find submission inet n and smtps inet n sections and edit as follows:

Edit the following values:

Finally, enable the postfix service:

Step 6. Installing and Configure Dovecot.

Install dovecot using the command bellow:

Open the /etc/dovecot/conf.d/10-mail.conf file:

Change the following values:

Open the /etc/dovecot/conf.d/10-auth.conf file:

Change the following values:

Create a new dovecot-sql.conf.ext file:

Edit the following values:

In the /etc/dovecot/conf.d/10-ssl.conf file enable SSL support:

Open the /etc/dovecot/conf.d/15-lda.conf file and set the postmaster_address email address:

Open the /etc/dovecot/conf.d/10-master.conf file, find the service lmtp section and change it to:

Find the service auth section and change it to:

Change the service auth-worker section to the following:

Now you need to assign the ownership of the files and folders. To do so, the command is:

Finally, enable and restart the dovecot service:

Step 7. Installing and configure Spamassassin.

Install spamassassin using the command bellow:

Create a spamassassin system user:

Next, configure Postfix to use SpamAssassin:

Change values:

With:

Add the following line at the end of the file:

Finally, restart the postfix service:

Step 8. Accessing PostfixAdmin.

If everything is set up correctly now you should be able to log in to your PostfixAdmin backend by going to http://Your_IP_Address/postfixadmin-3.0.2.2 and create your first virtual domain and mailbox.

Congratulation’s! You have successfully installed PostfixAdmin. Thanks for using this tutorial for installing Mail Server With PostfixAdmin on CentOS 7 system. For additional help or useful information, we recommend you to check the official PostfixAdmin web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!

Save

Share on Google+0Share on Facebook0Tweet about this on TwitterShare on Tumblr0Share on StumbleUpon1Share on Reddit1Pin on Pinterest1
The Tags:

Leave a Comment