Now that we have installed those required packages, we need to install and setup PostfixAdmin. Postfix Admin is a Web Based Management tool created for Postfix. It is a PHP based application that handles Postfix Style Virtual Domains and Users that are stored in MySQL. Below is the content of Install.txt that can be found together with the postfixadmin package.#
# Postfix Admin
# by Mischa Peters
# Copyright (c) 2002 - 2005 High5!
# License Info: http://www.postfixadmin.com/?file=LICENSE.TXT
#
REQUIRED!!
----------
- You are using Postfix 2.0 or higher.
- You are using Apache 1.3.27 or higher.
- You are using PHP 4.1 or higher.
- You are using MySQL 3.23 or higher.
READ THIS FIRST!
----------------
When this is an upgrade from Postfix Admin 1.5.4 please read UPGRADE.TXT!!
If you need to setup Postfix to be able to handle Virtual Domains and Virtual
Users check out http://high5.net/howto/
1. Unarchive new Postfix Admin
------------------------------
Make sure that you are in your WWW directory and then unarchive the
Postfix Admin archive (whatever the filename is):
$ tar -zxvf postfixadmin-2.0.0.tgz
2. Change permissions
----------------------
Since the database password is stored in the config.inc.php it's a good idea
to have change the permissions for Postfix Admin.
$ cd /usr/local/www/postfixadmin
$ chmod 640 *.php *.css
$ cd /usr/local/www/postfixadmin/admin/
$ chmod 640 *.php .ht*
$ cd /usr/local/www/postfixadmin/images/
$ chmod 640 *.gif *.png
$ cd /usr/local/www/postfixadmin/languages/
$ chmod 640 *.lang
$ cd /usr/local/www/postfixadmin/templates/
$ chmod 640 *.tpl
$ cd /usr/local/www/postfixadmin/users/
$ chmod 640 *.php
3. Create the Database Tables
--------------------------
In DATABASE_MYSQL.TXT you can find the table structure for MySQL that you need
in order to configure Postfix Admin and Postfix in general to work with
Virtual Domains and Users.
In DATABASE_PGSQL.TXT you can find the table structure for PostgreSQL.
4. Configure
------------
Check the config.inc.php file. There you can specify settings that are
relevant to your setup.
Postfix Admin contains 3 views of administration.
There is the Site Admin view, located at http://domain.tld/postfixadmin/admin/.
There is the Domain Admin view, located at http://domain.tld/postfixadmin/.
And there is the User Admin View, located at http://domain.tld/postfixadmin/users/.
In order to do the initial configuration you have to go to the Site Admin view.
The default password for the Site Admin view of Postfix Admin is admin/admin.
This is specified in the .htpasswd file in the /admin directory. Make sure
that the location of the .htpasswd file matches your path.
5. Done
-------
This is all that is needed. Fire up your browser and go to the site that you
specified to host Postfix Admin.
6. More information
-------------------
For more information you can go to the Postfix Admin forums.
http://forums.high5.net/index.php?showforum=22
Now assuming that postfix admin has been installed successfully, we will now try to reconfigure postfix for it to work as been expected.Edit "/etc/postfix/main.cf" and add the txt below:virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cfvirtual_gid_maps = static:89virtual_mailbox_base = /home/virtualmailvirtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cfvirtual_mailbox_limit = 51200000virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cfvirtual_minimum_uid = 89virtual_transport = virtualvirtual_uid_maps = static:89# Additional for quota supportvirtual_create_maildirsize = yesvirtual_mailbox_extended = yesvirtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cfvirtual_mailbox_limit_override = yesvirtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again latervirtual_overquota_bounce = yesNotes: Then, we have to manually create the file "myql_virtual_alias_maps.cf" and the others as defined on the main.cf file under /etc/postfix. Below are the entries that we should put on those files.#filename:mysql_virtual_alias_maps.cf, and below are the contents of this fileuser = postfixpassword = postfixhosts = localhostdbname = postfixtable = aliasselect_field = gotowhere_field = address#mysql_virtual_domains_maps.cfuser = postfixpassword = postfixhosts = localhostdbname = postfixtable = domainselect_field = descriptionwhere_field = domain#mysql_virtual_mailbox_maps.cfuser = postfixpassword = postfixhosts = localhostdbname = postfixtable = mailboxselect_field = maildirwhere_field = username#mysql_virtual_mailbox_limits_maps.cfuser = postfixpassword = postfixhosts = localhostdbname = postfixtable = mailboxselect_field = quotawhere_field = usernameNow that we've finished creating those files, we need to reload postfix to apply those changes we made.. (#/etc/init.d/postfix restart). We shall now try to open the url where we can access the postfixadmin page. If we won't encounter any problem at all, we should be able to add any virtual domain and virtual users. Those individual folders will be automatically created under the "/home/virtualmail" directory.Opps! when encountered a problem during adding a domain, thus that postfix admin will just prompt that the domain already exist, try to edit the php.ini file. The line that contains "magic_quote_gpc" should be changed to "ON". The default is off. Then try to reboot. If you can't afford to reboot, reload all the services that uses PHP.Now we will make some changes on /etc/authlib/authdaemonrc.The default is the commented authmodulelist below. I changed it to the value of the uncommented one, thus that contains only "authpam and authmysql"#///////////////////////////////#/etc/authlib/authdaemonrc
#authmodulelist="authuserdb authpam authpgsql authldap authmysql authcustom authpipe"
authmodulelist="authmysql authcustom authpam"
#if authpam is not included here, your local users wont be able to access IMAP or POP3 server
authmodulelistorig="authuserdb authpam authpgsql authldap authmysql authcustom authpipe"
#///////////////////////////////Then edit /etc/authlib/authmysqlrc the same as described below.#/etc/authlib/authmysqlrc
##NAME: LOCATION:0
# The server name, userid, and password used to log in.
MYSQL_SERVER localhost
MYSQL_USERNAME postfix
MYSQL_PASSWORD postfix
MYSQL_SOCKET /var/lib/mysql/mysql.sock
#MYSQL_PORT 3306
MYSQL_OPT 0
MYSQL_DATABASE postfix
MYSQL_USER_TABLE mailbox
MYSQL_CRYPT_PWFIELD password
#MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD '89'
MYSQL_GID_FIELD '89'
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD '/home/virtualmail'
MYSQL_NAME_FIELD name
MYSQL_MAILDIR_FIELD maildir
# MYSQL_QUOTA_FIELD quota
Note:
I assign the name postfix as mysql username and the password is also postfix, so you can change it to any name you like as long as you gave that name enough rights to access the database postfix on your mysql database.
Ok, after installing those described above, I then install and configure
squirrelmail to test that my webserver really run as I want it to be... I got my domain from http://dyndns.org. I point several subdomain to the IP assigned to the host act as the mail server and manage the the multiple subdomains and virtual email accounts via postfixadmin.
--