Postfixadmin is a web based management tool created for Postfix based mailservers. It is a PHP based application that handles Postfix style virtual domains and users that are stored in MySQL or PostgreSQL. This will enable you to add domains and users to your mailserver without having to dive into configuration files. It will also allow you to delegate the control of a single domain to another user, which would enable you to host domains for others.
Please download the source code form the PostfixAdmin project page at sourceforge.net. These instructions have only been tested with version 2.3.x
First you need to create a database, you can use a database management tool like phpMyAdmin or use the command line. For command line you can use the following commands whilst in mysql:
CREATE DATABASE postfix; CREATE USER 'postfix'@'localhost' IDENTIFIED BY 'postfixpassword'; GRANT ALL PRIVILEGES ON postfix.* TO 'postfix'@'localhost';
This will have created a database named “postfix” and a user named “postfix” who can logon with password “postfixpassword”. Please do not use “postfixpassword” as the actual password and choose someting of your own.
Unpack the downloaded postfixadmin archive into the directory ‘/Library/WebServer/Documents‘, that is if you used our installation instructions. Otherwise extract it in the document root of your Apache installation.
For ease of use you can rename the directory ‘postfixadmin-2.2.x‘ to just ‘postfixadmin‘ or create a symbolic link to that directory as follows:
sudo ln -s /Library/WebServer/Documents/postfixadmin-2.3.3 /Library/WebServer/Documents/postfixadmin
When you’re done you need to edit the file ‘
The most important settings are those for your database server settings:
You must also change the line that says :
$CONF['configured'] = false;
$CONF['configured'] = true;
Change your URL location:
$CONF['postfix_admin_url'] = 'http://yourserver.tld/postfixadmin';
and change the database config block into:
$CONF['database_type'] = 'mysqli'; $CONF['database_host'] = 'localhost'; $CONF['database_user'] = 'postfix'; $CONF['database_password'] = 'postfixpassword'; $CONF['database_name'] = 'postfix'; $CONF['database_prefix'] = '';
When you finish, save the file and go to http://yourserver.tld/postfixadmin/setup.php in a web browser. The script will check your environment and you should see a list of ‘OK’ messages. The setup.php script will attempt to create the database structure.
Assuming everything is OK you need to specify a setup password. When you’ve done this you need to add the line with the setup password in a hash into the “config.inc.php” file. When you’ve done this you can proceed to the next step, setting up the admin user.
For setting up the admin user you need to specify the setup password (the one you just created) specify an email address (does not need to be an email address hosted by your server) and a make up a password and press the button.
You can then go into ‘http://yourserver.tld/postfixadmin/‘, login with your newly created admin user to administrate your users and domain admins.