Within the file /etc/postfixadmin/config.inc.php the following parameters need altering :
#vim /var/www/html/postfixadmin/config.inc.php
find and change like this:
$CONF['quota'] = 'YES'; $CONF['used_quota_table'] = 'YES'; $CONF['new_quota_table'] = 'YES';
Create file /etc/dovecot/dovecot-dict-sql-user.conf, and populate it with the following information ensure that you change "postfix_complex_password" to the MySQL mail access account that can select, update, delete the quota2 table:
#vim /etc/dovecot/dovecot-dict-sql-user.conf
connect = host=localhost dbname=postfix user=postfix password=postfix_complex_password map { pattern = priv/quota/storage table = quota2 username_field = username value_field = bytes } map { pattern = priv/quota/messages table = quota2 username_field = username value_field = messages }
#vim /etc/dovecot/dovecot-dict-sql-domain.conf
connect = host=localhost dbname=postfix user=postfix password=postfix_complex_password map { pattern = priv/quota/storage table = domain username_field = domain value_field = quota } map { pattern = priv/quota/messages table = quota2 username_field = username value_field = messages }
#vim /etc/dovecot/dovecot.conf
mail_plugins = $mail_plugins quota userdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } passdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } service dict { unix_listener dict { mode = 0600 user = vmail } } protocol imap { mail_plugins = $mail_plugins imap_quota } plugin { # Using SQL Tables to store current quota size quota = dict:Quota:%d:proxy::sqldomainquota quota = dict:User Quota::proxy::sqluserquota # Allow 10% more for Trash Folder quota_rule2 = Trash:storage=+10%% } dict { sqluserquota = mysql:/etc/dovecot/dovecot-dict-sql-user.conf sqldomainquota = mysql:/etc/dovecot/dovecot-sql-domain.conf }
The/etc/dovecot/dovecot-sql.conf.ext needs to be amended as follows :
/etc/dovecot/dovecot-sql.conf.ext no need to change coz we created in first step.
#service dovecot restart
Check the /var/log/syslog to see if the Dovecot service has successfully started. Also check the /var/log/mail.log to see if it is successfully processing imap calls.
then test send file attach with over quota size and check log: /var/log/syslog
Add check-quota-plugin display status in SquirrelMail
================
http://blog.shines.me.uk/configuring-domain-user-mailbox-quotas-in-dovecot-via-postfixadmin-on-ubuntu-12-04lts/