Note: These instructions are identical for Leopard and Snow Leopard.
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.
Please download the source code form the PostfixAdmin project page at sourceforge.net. These instructions have only been tested with version 2.2.x.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 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:
When you’re done you need to edit the file ‘config.inc.php‘ file.
The most important settings are those for your database server settings:
You must also change the line that says :
to
Change your URL location:
and change the database config block into:
$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 can specify an email address and a make up a password and press the button. Please remember these as you will need them the following time when you want to administer your server. When the admin user is added succesfully remove the setup.php file for security by using the following command:
You can then go into ‘http://yourserver.tld/postfixadmin/‘ to administrate your users and domain admins. Log in with your newly created admin account to add users and domains.



8:39 pm
Hi Richard,
I’m getting a bit closer but got this problem now.
[Thu Aug 20 21:37:27 2009] [error] [client ::1] File does not exist: /Library/WebServer/Documents/idsmac.net/postfixadmin
The folder postfixadmin in the Documents folder but this error suggest it needs to be in website folder.
Any clue
Luc
8:24 pm
Luc, my best guess would be that you are trying to reach postfix admin through one of your virtual domains which won’t work if you put it in the Documents folder. To make this work you either need to move postfix admin into a site folder or access it via your http://hostname/postfixadmin
2:54 am
Richard,
I got a lot further now but I get this error on the postfixadmin setup:
Warning: Depends on: IMAP functions – NOT FOUND
To install IMAP support, install php5-imap
Without IMAP support, you won’t be able to create subfolders when creating mailboxes.
I don’t see in the php install tutorial where I needed to do anything with Imap. Did I miss it? Or is this warning expected and should I move on to the next step?
thanks
6:59 am
@Rodrigo, do not worry, everything will work without the imap module. It’s only required for some special stuff we aren’t using.
9:38 pm
I went ahead and follow through, however, when I input the setup password the next screen said to put the generated hash value in the config.inc.php page and it asked me to input the setup password again followed by the admin email and new admin password. When I hit submit the page turns all white.
Following the tutorial I went to myserver/postfixadmin and the form to login shows up but it keeps saying the username or password do not match.
I checked my database and the postfix user exists and has priviledges. But the admin user is never created in the admin table. Any suggestions?
Thank you