How to Install Postfix Admin in RHEL/CentOS 5/6

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 php-mysql php-imap
 php-mbstring
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.gzand 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.3.5.tar.gz
mv postfixadmin-2.3.5 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.

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

1. Start the mysqld service. Learn how to start and stop services here.
2. 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

1. Create the file /etc/httpd/conf.d/postfixadmin.confcontaining the line below.

Alias /postfixadmin /usr/share/postfixadmin
2. Type the commands below to enable PostfixAdmin to function properly under SELinux.

setsebool httpd_can_network_connect on
setsebool httpd_can_sendmail on
3. Start or restart the httpd service. Learn how to start and stop services here.
4. 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.
5. 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.
6. Go to the Postfix Admin login page at http://localhost/postfixadmin/ and login using your newly created admin account.
7. Congratulations, it works.
NoteIf you encounter any problems, check the log file at /var/log/httpd/error_log.

 

3 Responses to How to Install Postfix Admin in RHEL/CentOS 5/6

  1. Kevin says:

    I am just a noob tryin to learn and get my feet wet while I am in school for Computer Science. I know how important it is to find the latest information to insure that I am following instructions for the correct version of RHEL. Imagine how pleased I was when I saw the date of your post, to find that I am, in fact, using information from the future. I guess I can’t get any more up to date. 🙂

    • Kevin says:

      The above referenced post was made in complete humor of course. Us silly americans are used to the date being stated in the mm/dd/yyyy format, and the post was made purely in jest.

      Thank you for the great step by step. Worked great, my system is up and running perfectly.

  2. Johnf595 says:

    I am just seeming both for blog sites which give independent, nutritious commentary on all difficulties or blogging sites which have a liberal or droppedwing slant. Thank you.. afdkafabddec

Leave a Reply

Your email address will not be published.