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

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 -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

2. Start or restart the httpd service. Learn how to start and stop services here.
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.
If 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 12/15/2009
Filed under CentOS 5 , Postfix , Red Hat Enterprise Linux 5

March 21st, 2009 at 6:05 pm
1. Start the mysqld service.
mysqld is not on the list of services…
Building this from scratch, following all instructions, everything else has gone smoothly.
March 21st, 2009 at 11:43 pm
Hi Scott,
You’re right, mysql is indeed missing. Turns out mysql is already included in my setup that’s why it showed up. Sorry about that.
Type in yum install mysql-server to install the correct package.
March 22nd, 2009 at 5:54 pm
Thank you for the prompt and helpful reply! I did the yum install no problem.
Since I’m a little off track now, there are some further problems. I started mysql server and restarted http.
Now I can browse to setup.php, but it gives a status page which lists the error:
Can’t connect to database
Please edit the $CONF['database_*'] parameters in config.inc.php
I can browse to postfixadmin, but it says to delete setup.php
I don’t know how to fix the $CONF, I entered them exactly as instructed.
March 22nd, 2009 at 6:11 pm
Follow-up: If I delete setup.php, I can browse to the login page for postfix admin, but I can’t figure out a username and password that works.
March 22nd, 2009 at 10:12 pm
Hi Scott,
After installing mysql and starting mysql, you need to start from step 2 of Creating the Postfix Admin Database and proceed from there.
March 23rd, 2009 at 12:51 am
Hi..Scott
I have probelm on postfixadmin that following this.
1.I can’t Add mail box on doamin such as cti.co.th
it show me invalid email account.
2.I can’t setup squirrel mail Address book on Web
Please help me.
somchai w
March 26th, 2009 at 9:38 pm
Hmmm…Went back as you suggested and the first line responds that the database already exists. The second line wants a password, leaving it blank doesn’t work nor does the root or my password. Third line seems to take OK. Browsing to setup.php and postfixadmin still yield the same errors I reported above. Any further suggestions?
Not that it matters, but I’m feeling good because I got virtual name servers working in Apache and am on the web.
P.S. Note to somchai: I am a beginner when it comes to Linux and unable to assist you. Good luck.
April 2nd, 2009 at 2:14 pm
Every 6 months or so I get frustrated with MS and try to build a Linux box. Every time I get a little further in the project because I’ve learned a little more. Every time I wind up giving up because I run into a snag that I cannot solve. Seems this time will be no different… Bill Gates is laughing all the way to the bank.
September 11th, 2009 at 2:24 pm
Error Downloading Packages:
mysql-server – 5.0.45-7.el5.i386: failure: CentOS/mysql-server-5.0.45-7.el5.i386.rpm from base: [Errno 256] No more mirrors to try. what i the remedy for this.
September 11th, 2009 at 9:08 pm
Hi shanmuga sundaram s,
Make sure the linux machine has internet access. If it has, just try it again. It could be a temporary problem.