[root@mail1 postfixadmin]# cp config.inc.php.sample config.ini.php
[root@mail1 ~]# cd /var/www/postfixadmin/
[root@mail1 postfixadmin]# ll
total 220
drwxr-xr-x 2 vmail vmail 4096 Jan 7 2005 ADDITIONS
drwxr-xr-x 2 vmail vmail 4096 Feb 19 05:04 admin
-rw-r--r-- 1 vmail vmail 1195 Jan 7 2005 BACKUP_MX.TXT
-rw-r--r-- 1 vmail vmail 10155 Jan 7 2005 CHANGELOG.TXT
-rw-r--r-- 1 vmail vmail 4733 Feb 20 06:14 config.inc.php
-rw-r--r-- 1 vmail vmail 4694 Jan 7 2005 config.inc.php.sample
-rw-r--r-- 1 vmail vmail 3774 Jan 7 2005 create-alias.php
-rw-r--r-- 1 vmail vmail 7379 Feb 19 05:04 create-mailbox.php
-rw-r--r-- 1 vmail vmail 4910 Jan 7 2005 DATABASE_MYSQL.TXT
-rw-r--r-- 1 vmail vmail 4955 Jan 7 2005 DATABASE_PGSQL.TXT
[root@mail1 postfixadmin]# more config.inc.php
$CONF['postfix_admin_url'] = '';
$CONF['postfix_admin_path'] = '';
$CONF['default_language'] = 'cn';
$CONF['database_type'] = 'mysql';
$CONF['database_host'] = 'localhost';
$CONF['database_user'] = 'postfixadmin';
$CONF['database_password'] = 'postfixadmin';
$CONF['database_name'] = 'postfix';
$CONF['database_prefix'] = '';
$CONF['admin_email'] = '[email protected]';
$CONF['smtp_server'] = 'localhost';
$CONF['smtp_port'] = '25';
$CONF['encrypt'] = 'md5crypt';
注:与courier-authlib的配置文件authmysqlrc以及Webmail(Extmail)的文件Webmail.cf都有关联,这三者一定要一致。
$CONF['page_size'] = '10';
$CONF['domain_path'] = 'YES'; ------这样修改后postfixadmin添加用户时生成的目录 为/var/mailbox/mail.sery.com/benly
$CONF['domain_in_mailbox'] = 'NO';
$CONF['aliases'] = '1000';
$CONF['mailboxes'] = '1000';
$CONF['maxquota'] = '1000';
$CONF['quota_multiplier'] = '1024000';
$CONF['transport'] = 'NO';
$CONF['vacation'] = 'NO';
$CONF['vacation_domain'] = 'autoreply.change-this-to-your.domain.tld';
$CONF['alias_control'] = 'NO';
$CONF['special_alias_control'] = 'YES';
$CONF['logging'] = 'YES';
$CONF['show_header_text'] = 'NO';
$CONF['header_text'] = ':: Postfix Admin ::';
$CONF['show_footer_text'] = 'YES';
$CONF['footer_text'] = 'Return to change-this-to-your.domain.tld';
$CONF['footer_link'] = 'http://change-this-to-your.domain.tld';
$CONF['welcome_text'] = <<<EOM
Hi,
Welcome to your new account.
EOM;
[root@mailserv2 postfixadmin]#
more create-mailbox.php
//
// Postfix Admin
// by Mischa Peters
// Copyright (c) 2002 - 2005 High5!
// License Info: [url]http://www.postfixadmin.com/?file=LICENSE.TXT[/url]
……………………………………
省略若干……………………………………
.
$tQuota = $CONF['maxquota'];
system("sudo /usr/sbin/maildirmake.sh $fDomain ".$_POST['fUsername']);
if ($fMail == "on")
……………………………………
省略若干……………………………………
.
?>
|
[root@mailserv2 postfixadmin]# vi delete.php
………………………………………
.
省略很多………………………………
require ("./variables.inc.php");
require ("./config.inc.php");
require ("./functions.inc.php");
include ("./languages/" . check_language () . ".lang");
$SESSID_USERNAME = check_session();
………………………………………
.
省略很多………………………………
$result = db_query ("SELECT * FROM mailbox WHERE username='$fDelete' AND domain='$fDomain'");
$userarray=explode("@",$fDelete);
$user=$userarray[0];
$domain=$userarray[1];
system("sudo /usr/sbin/maildirdel.sh $domain $user");
………………………………………
.
省略很多………………………………
?>
|
[root@mailserv2 ~] #
cd /var/www/postfixadmin
|
[root@mail1 postfixadmin]# mysql -u root -p password < DATABASE_MYSQL.TXT
|
Alias /postfixadmin /var/www/postfixadmin
<Directory /var/www/postfixadmin>
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/postfixadmin/admin">
AuthType Basic
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "sery.mail Access"
AuthUserFile /usr/local/apache/conf/htpasswd
Require valid-user
</Directory>
|