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

yum install1. Install the Postfix Admin requirements using the command below.
yum install mysql-server php php-mysql php-imap
tar postfixadmin
2. Download the latest stable version of Postfix Admin in .tar.gz format here. Assuming you got the file postfixadmin- 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-
mv postfixadmin- postfixadmin

NoteThe PostfixAdmin archive has to be extracted directly into the /usr/share directory to enable Linux to apply the proper SELinux context into the files.

Edit postfixadmin.conf
3. Edit the file /usr/share/postfixadmin/ 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

Service Configuration1. Start the mysqld service. Learn how to start and stop services here.
Create Postfix Admin db2. Launch the MySQL command line tool using the command below.
mysql -u root -p
The 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

Edit postfixadmin.conf1. Create the file /etc/httpd/conf.d/postfixadmin.conf containing the line below.
Alias /postfixadmin /usr/share/postfixadmin
setsebool httpd2. Type the commands below to enable PostfixAdmin to function properly under SELinux.
setsebool httpd_can_network_connect on
setsebool httpd_can_sendmail on
Service Configuration3. Start or restart the httpd service. Learn how to start and stop services here.
Postfix Admin Setup4. 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.
Postfix Admin Setup5. Get the generated setup password hash and put it into the file /usr/share/postfixadmin/ Next, fill in the Setup password, Admin and Password and Password (again). Finally, click Add Admin to create a new admin account.
Postfix Admin Login6. Go to the Postfix Admin login page at http://localhost/postfixadmin/ and login using your newly created admin account.
Postfix Admin Main7. Congratulations, it works.
NoteIf you encounter any problems, check the log file at /var/log/httpd/error_log.

Visit the forum to ask for help or to give a comment.

Posted on 2/22/2009 and last updated on 8/29/2011
Filed under CentOS 5 , CentOS 6 , Postfix , Red Hat Enterprise Linux 5 , Red Hat Enterprise Linux 6