1.Пересобераешь Postfix c поддержкой MySQL:
#cd /usr/ports/mail/postfix25/
#make config
[x]MYSQL
#make install
2.Создаешь базу postfix в MySQL:
mysql>
CREATE DATABASE postfix;
CREATE USER 'postfix'@'localhost' IDENTIFIED BY '1234567';
GRANT ALL PRIVILEGES ON postfix.* TO postfix@localhost IDENTIFIED BY '1234567' WITH GRANT OPTION;
3.Создаеш подкаталог для MYSQL, и создаеш три файла
#mkdir /usr/local/etc/postfix/mysql
#cd /usr/local/etc/postfix/mysql
#touch alias.conf
#touch domain.conf
#touch mailbox.conf
Редактируем файлы
ee alias.conf
user = postfix #Пароль пользователя mysql
password = 1234567 #Его пароль
hosts = localhost #Расположение mysql базы
dbname = postfix #Название базы
table = alias
select_field = goto
where_field = address
ee domain.conf
user = postfix
password = 1234567
hosts = localhost
dbname = postfix
table = domain
select_field = description
where_field = domain
additional_conditions = and active = '1' and backupmx = '0'
ee mailbox.conf
user = postfix
password = 1234567
hosts = localhost
dbname = postfix
table = domain
select_field = description
where_field = domain
additional_conditions = and active = '1' and backupmx = '0'
ee main.cf
virtual_alias_maps = mysql:$base/mysql/alias.conf
virtual_mailbox_domains = mysql:$base/mysql/domain.conf
virtual_mailbox_maps = mysql:$base/mysql/mailbox.conf
Дальше ставишь POSTFIXADMIN
cd /usr/ports/mail/postfixadmin/
ee config.inc.php !
$CONF['configured'] = true;
$CONF[‘database_user’] = ‘postfix’;
$CONF['database_password'] = '1234567;
$CONF['database_name'] = 'postfix';
host/postfixadmin/setup.php
создаем там пользователя для администрирование через веб интерфейс
Удаляем setup.php
host/postfixadmin/login.php
КАК ТО ТАК!