Debian: Install Email server Postfix,Postfixadmin and Dovecot with Mysql

1.install Postfixadmin


install package:

#aptitude install mysql-server mysql-client php5 php5-mysql apt-get install php5-xcache apache2 wget php5-imap php5-xcache

Create PostfixAdmin database:

Execute adjusting the RED TEXT 

# mysql -u root -p

 (Enter MySQL root password)
> CREATE DATABASE postfix;
> CREATE USER 'postfix_user'@'localhost' IDENTIFIED BY '123456';
> SET PASSWORD FOR 'postfix'@'localhost' = PASSWORD('postfix@123456');
> GRANT ALL PRIVILEGES ON `postfix`.* TO 'postfix'@'localhost';
> FLUSH PRIVILEGES;
> QUIT;

Secure PostfixAdmin files:

# cd /var/www/postfixadmin

# find . -type f -exec chmod 640 {} \; 
# find . -type d -exec chmod 750 {} \;

#cd /usr/src
#wget http://ncu.dl.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-2.3.6/postfixadmin-2.3.6.tar.gz


#tar -xzvf postfixadmin-2.3.6.tar.gz
#mv postfixadmin-2.3.5 /var/www/postfixadmin
Configure apache2
#vim /etc/apache2/sites-available/000-default.conf
Add and verify similar with this:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/html/postfixadmin/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
Require ip 10.105.0.0/16
</RequireAny>
</IfModule>
</Directory>
# Apache 2.2
#Options FollowSymLinks
#AllowOverride None
#Order allow,deny
#allow from 10.105.0.0/16
#allow from all
#</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Next, we edit the config file /var/www/postfixadmin/config.inc.php to specify the details of our setup. We must edit the mysql database name, and the username/password to access it:

#vim /var/www/postfixadmin/config.inc.php


$CONF['configured'] = true;
...
$CONF['postfix_admin_url'] = 'http://server-ip/postfixadmin/';
...
$CONF['database_type'] = 'mysql';
$CONF['database_host'] = '127.0.0.1';
$CONF['database_user'] = 'postfix_user';
$CONF['database_password'] = '123456';
$CONF['database_name'] = 'postfix';
...
$CONF['admin_email'] = '';
...
$CONF['default_aliases'] = array (
        'abuse' => 'abuse@domain.tld',
        'hostmaster' => 'hostmaster@domain.tld',
        'postmaster' => 'postmaster@domain.tld',
        'webmaster' => 'webmaster@domain.tld'
);
...
$CONF['domain_path'] = 'NO';
...
$CONF['domain_in_mailbox'] = 'YES';
...
$CONF['aliases'] = '10';
$CONF['mailboxes'] = '10';
$CONF['maxquota'] = '10';
...
$CONF['quota'] = 'NO';
...
$CONF['quota_multiplier'] = '1048576';
...
$CONF['vacation'] = 'NO';
...
$CONF['vacation_domain'] = 'autoreply.domain.tld';
...
$CONF['user_footer_link'] = 'http://www.domain.tld/';
...
$CONF['footer_text'] = 'Return to domain.tld';
$CONF['footer_link'] = 'http://www.domain.tld/';
...
$CONF['welcome_text'] = <<<EOM
EOM;
?>
...
$CONF['emailcheck_resolve_domain']='NO';
...
#$CONF['mailbox_postdeletion_script']='sudo -u vscan 
/usr/local/bin/postfixadmin-mailbox-postdeletion.sh';
...
#$CONF['domain_postdeletion_script']='sudo -u vscan 
/usr/local/bin/postfixadmin-domain-postdeletion.sh';
...
$CONF['used_quotas'] = 'NO';
...
$CONF['new_quota_table'] = 'NO'; 

Page
1 2 3 4