Install Postfixadmin
Find uid and guid of user postfix :
# id postfix
uid=109(postfix) gid=117(postfix) groups=117(postfix)
Edit dovecot-sql.conf :
# nano /etc/dovecot/dovecot-sql.conf
change it from :
125 AS uid, 125 AS gid
into :
109 AS uid, 117 AS gid
and save the file.
Edit main.cf
# nano /etc/postfix/main.cf
Change these section :
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:117
virtual_mailbox_base = /usr/local/virtual
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 51200000
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 109
virtual_transport = virtual
virtual_uid_maps = static:109
Create database for postfix :
# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 35
Server version: 5.1.31-1ubuntu2 (Ubuntu)Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql> create database postfix;
Query OK, 1 row affected (0.00 sec)mysql> grant all privileges on postfix.* to postfix@localhost identified by ‘postfix2008′ with grant option;
Query OK, 0 rows affected (0.00 sec)mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)mysql>exit
Install postfixadmin :
# wget http://transact.dl.sourceforge.net/sourceforge/postfixadmin/postfixadmin-2.2.1.1.tar.gz
# tar -xvzf postfixadmin-2.2.1.1.tar.gz
# mv postfixadmin-2.2.1.1 /var/www/nginx-default/postfixadmin
# cd /var/www/nginx-default/postfixadmin/
Edit config.inc.php :
$CONF['configured'] = true;
$CONF['postfix_admin_url'] = ‘http://postfixadmin.digitalfusi.com/‘;
$CONF['database_type'] = ‘mysqli‘;
$CONF['database_host'] = ‘localhost‘;
$CONF['database_user'] = ‘postfix‘;
$CONF['database_password'] = ‘postfixjaunty’;
$CONF['database_name'] = ‘postfix‘;
$CONF['database_prefix'] = ”;
$CONF['admin_email'] = ‘postmaster@digitalfusi.com‘;
$CONF['default_aliases'] = array (
‘abuse’ => ‘abuse@digitalfusi.com‘,
‘hostmaster’ => ‘hostmaster@digitalfusi.com‘,
‘postmaster’ => ‘postmaster@digitalfusi.com‘,
‘webmaster’ => ‘webmaster@digitalfusi.com‘
);
$CONF['generate_password'] = ‘NO‘;
$CONF['page_size'] = ‘20‘;
$CONF['domain_path'] = ‘YES‘;
$CONF['domain_in_mailbox'] = ‘NO‘;
$CONF['encrypt'] = ‘md5‘;
$CONF['aliases'] = ‘50‘;
$CONF['mailboxes'] = ‘50‘;
$CONF['maxquota'] = ‘1024‘;
$CONF['quota'] = ‘YES‘;
$CONF['quota_multiplier'] = ‘1048576‘;
$CONF['transport'] = ‘NO‘;
$CONF['vacation'] = ‘YES‘;
$CONF['vacation_domain'] = ‘autoreply.digitalfusi.com‘;
$CONF['alias_control_admin'] = ‘YES‘;
$CONF['special_alias_control'] = ‘YES‘;
$CONF['show_header_text'] = ‘YES‘;
$CONF['header_text'] = ‘:: Postfix Admin ::‘;
$CONF['show_footer_text'] = ‘YES‘;
$CONF['footer_text'] = ‘Return to postfixadmin‘;
$CONF['user_footer_link'] = ‘http://postfixadmin.digitalfusi.com/‘;
$CONF['welcome_text'] = <<<EOM
Hello,Welcome to your new email account!
For questions or comments regarding your mail account,
please feel free to send an email to support@digitalfusi.com.
Likewise, any other inqueries regarding digitalfusi or their
affiliates can be sent to the same address.Also, don’t forget to check your mail settings via Maia-
Mailguard located at http://mailguard.digitalfusi.com/.
Simply log into your account using your email address
and password. That’s it! From Maia-Mailguard, you can
adjust your spam, virus, malware, whitelists, blacklists,
etc… This will put you in full control of your email so
you never miss anything important.Enjoy your new email
account!Regards,
Alamsyah Rasyid
support@digitalfusi.com
EOM;
?>
Setting postfixadmin by accessing :
http://postfixadmin.digitalfusi.com/setup.php
Edit /etc/nginx/sites-available/default and add these lines :
# postfixadmin
server {
listen 80;
server_name postfixadmin.digitalfusi.com;location / {
index index.php index.html;
root /var/www/nginx-default/postfixadmin;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/nginx-default/postfixadmin$fastcgi_script_name;
include fastcgi_params;
}}
Restart nginx.
Delete setup.php first before continue to this step and make sure to see these message :
Postfix Admin Setup Checker
Running software:
- PHP version 5.2.6-3ubuntu4
Checking for dependencies:
- Warning: Magic Quotes: ON (internal workaround used)
- Depends on: presence config.inc.php – OK
- Checking $CONF['configured'] – OK
- Depends on: MySQL 3.23, 4.0 – OK
- Depends on: MySQL 4.1 – OK (change the database_type to ‘mysqli’ in config.inc.php!!)
- Testing database connection – OK – mysql://postfix:xxxxx@localhost/postfix
- Depends on: session – OK
- Depends on: pcre – OK
- Depends on: multibyte string – OK
- Depends on: IMAP functions – OK
Everything seems fine… attempting to create/update database structure
Database is up to date
Admin has been added!
(alamster@gmail.com)You can now log in to Postfix Admin.
Make sure you delete this setup.php file!
Also check the config.inc.php file for any settings that you might need to change!
Access from browser :
http://postfixadmin.digitalfusi.com