Postfix Admin is a web based interface used to manage mailboxes, virtual domains and aliases. This article will show you how to install Postfix Admin to simplify management of mailboxes, domains and aliases.
Installing Postfix Admin


1. Install the Postfix Admin requirements using the command below.
yum install mysql-server php-mysql php-imap


2. Download the latest stable version of Postfix Admin in .tar.gz format here. Assuming you got the file postfixadmin-2.2.1.1.tar.gz and it is located on your Desktop, type in the commands below to extract and to put it into its proper directory.
cd /usr/share
tar -xvzf ~/Desktop/postfixadmin-2.2.1.1.tar.gz
mv postfixadmin-2.2.1.1 postfixadmin
The PostfixAdmin archive has to be extracted directly into the /usr/share directory to enable Linux to apply the proper SELinux Context into the files.


3. Edit the file /usr/share/postfixadmin/config.inc.php and update the following lines below.
$CONF['configured'] = true;
$CONF['postfix_admin_url'] = '/postfixadmin';
$CONF['database_type'] = 'mysqli';
$CONF['database_host'] = 'localhost';
$CONF['database_user'] = 'postfix';
$CONF['database_password'] = 'your_password';
$CONF['database_name'] = 'postfix';
$CONF['domain_path'] = 'YES';
$CONF['domain_in_mailbox'] = 'NO';
$CONF['encrypt'] = 'cleartext';
$CONF['emailcheck_resolve_domain] = 'NO';
Creating the Postfix Admin Database


2. Launch the MySQL command line tool using the command below.
mysql -u root -pThe default root password of MySQL is a blank password. Next, create a new MySQL database for Postfix Admin using the commands below.
mysql> CREATE DATABASE postfix;
mysql> CREATE USER postfix@localhost IDENTIFIED BY 'your_password';
mysql> GRANT ALL PRIVILEGES ON postfix.* TO postfix;
Configuring the Postfix Admin Web Application


1. Create the file /etc/httpd/conf.d/postfixadmin.conf containing the line below.
Alias /postfixadmin /usr/share/postfixadmin


3. Go to the Postfix Admin setup page at http://localhost/postfixadmin/setup.php and fill in the setup password. Next, click the Generate password hash.


4. Get the generated setup password hash and put it into the file /usr/share/postfixadmin/config.inc.php. Next, fill in the Setup password, Admin and Password and Password (again). Finally, click Add Admin to create a new admin account.


5. Go to the Postfix Admin login page at http://localhost/postfixadmin/ and login using your newly created admin account.

REFERENCE