[Dovecot] Please help with Quota dict mysql configuration

Denis Iskandarov d.iskandarov at gmail.com
Fri Jun 24 12:35:13 EEST 2011


Hello
So what i have:
centos 5.6
postfix 2.3.3
dovecot 2.0.13
postfixadmin 2.3.3
roundcube 0.5.3

All general things are working right now i can send receive email with
ssl connections etc...
Now i'm trying to configure additional options like quota and some
other plugins like sieve, trash, expire and deleted-to-trash.
Configuration of quota is on first place. I have read wiki regarding
quota config , dict config but can't make things running.
Hope there are normal sample configs you can share with me.
I'm total noob in sql, so it's very difficult for me to arrange stuff
in a way i need.

My configs:

dict {
  quota = mysql:/etc/dovecot/conf.d/sql/dovecot-dict-sql.conf
#  expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf
}

dovecot-dict-sql.conf sample i took from postfixadmin docs provided
with package, also changed table to quota2 as suggested for dovecot 2:
driver = mysql
connect = host=localhost dbname=postfix user=postfix password=postfixadmin
default_pass_scheme = MD5-CRYPT
table = quota2
select_field = current
where_field = path
username_field = username

my sql.conf i took it from tutorial on your wiki : LDA postfix postfixadmin:

driver = mysql

connect = host=localhost dbname=postfix user=postfix password=postfixadmin

user_query = SELECT concat('/home/vmail/', maildir) as home,
concat('maildir:/home/vmail/', maildir) as mail, 1001 AS uid, 12 AS
gid, concat('maildir:storage=', quota) AS quota FROM mailbox WHERE
username = '%u' AND active = '1'
#user_query = SELECT maildir, 1001 AS uid, 1001 AS gid,
CONCAT('dict:storage=',floor(quota/1000),' proxy::quota') as quota
FROM mailbox WHERE username = '%u' AND active='1'

password_query = SELECT username as user, password,
concat('/home/vmail/', maildir) as userdb_home,
concat('maildir:/home/vmail/', maildir) as userdb_mail, 1001 as
userdb_uid, 12 as userdb_gid FROM mailbox WHERE username = '%u' AND
active = '1'

The second user_query string i took from postfixadmin docs. But i dont
know how to aply it. If it is better to use with mysql/postfixadmin

and after this all i dont how to configure quota.conf (90-quota.conf):

plugin {
  #quota = dirsize:User quota
  #quota = maildir:User quota
  #quota = dict:User quota::proxy::quota
  #quota = fs:User quota
}

# Multiple quota roots are also possible, for example this gives each user
# their own 100MB quota and one shared 1GB quota within the domain:
plugin {
  #quota = dict:user::proxy::quota
  #quota2 = dict:domain:%d:proxy::quota_domain
  #quota_rule = *:storage=102400
  #quota2_rule = *:storage=1048576
}

Please help me with configuration. I really stuck with this thing. And
yes i've tried to find solutions on mailing list, but no luck.
I want per domain/user quota in mysql. Also space usage to be shown in
roundcube.
Hope to get proper help  ...
And sorry...
Thanks in advance.


More information about the dovecot mailing list