[Dovecot] Dovecot 1.2.11, Quota and SQL

Mikaël PIRIO mikael.pirio at des-mondes-singuliers.fr
Fri Apr 9 16:43:21 EEST 2010


Hello,

I have a problem :(...

I try to define User Quotas in Dovecot (in my DB mySQL) but default 
quotas (in my dovecot.conf) are always set for all users.

I've  defined default quota to 500M. I set 0 to one account in my DB but 
when i see my logs, this account have a 500M quota !

Could you help me ?

My configuration :

# 1.2.11: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.18-xenU i686 Debian 5.0.4 ext3
log_path: /var/log/dovecot.err
info_log_path: /var/log/dovecot.info
log_timestamp: %Y-%m-%d %H:%M:%S
protocols: imap
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable: /usr/lib/dovecot/imap-login
mail_location: maildir:/var/vmail/%d/%n/.maildir
mail_debug: yes
mbox_write_locks: fcntl dotlock
mail_plugins: quota imap_quota
auth default:
   debug: yes
   debug_passwords: yes
   passdb:
     driver: pam
   passdb:
     driver: sql
     args: /etc/dovecot/dovecot-sql.conf
   userdb:
     driver: passwd
   userdb:
     driver: static
     args: uid=vmail gid=vmail home=/var/vmail/%d/%n
   userdb:
     driver: sql
     args: /etc/dovecot/dovecot-sql.conf
   socket:
     type: listen
     master:
       path: /var/run/dovecot/auth-master
       mode: 384
       user: vmail
       group: vmail
plugin:
   quota: maildir:User quota
   quota_rule: *:storage=500M
   quota_rule2: Trash:storage=10M



My dovecote-sql.conf :

driver = mysql
connect = host=localhost dbname=mail user=mail password=MyPassWord
default_pass_scheme = CRYPT
password_query = SELECT full_address AS user, password FROM 
admin_mailbox WHERE full_address = '%u'
user_query = SELECT path AS home, uid, gid, concat('*:storage=', quota, 
'M') AS quota_rule FROM admin_mailbox WHERE full_address = '%u'


When I request my DB, it's OK :

mysql> SELECT path AS home, uid, gid, concat('*:storage=', quota, 'M') 
AS quota_rule FROM admin_mailbox WHERE full_address = 'toto at dom.tld';
+------------------------+-----+-----+--------------+
| home                   | uid | gid | quota_rule   |
+------------------------+-----+-----+--------------+
| dom.tld/toto/.maildir/ | 500 | 500 | *:storage=0M |
+-------------- ---------+-----+-----+--------------+
1 row in set (0.00 sec)


But when i see my logs :

IMAP(toto at dom.tld): Info: Loading modules from directory: 
/usr/lib/dovecot/modules/imap
IMAP(toto at dom.tld): Info: Module loaded: 
/usr/lib/dovecot/modules/imap/lib10_quota_plugin.so
IMAP(toto at dom.tld): Info: Module loaded: 
/usr/lib/dovecot/modules/imap/lib11_imap_quota_plugin.so
IMAP(toto at dom.tld): Info: Effective uid=1002, gid=1004, 
home=/var/vmail/dom.tld/toto
IMAP(toto at dom.tld): Info: Quota root: name=User quota backend=maildir args=
IMAP(toto at dom.tld): Info: Quota rule: root=User quota mailbox=* 
bytes=524288000 messages=0
IMAP(toto at dom.tld): Info: Quota rule: root=User quota mailbox=Trash 
bytes=10485760 messages=0


Thanks for your help,
-- 
Mikaël,




More information about the dovecot mailing list