[Dovecot] postfix/dovecot/mysql quotas not working, default dovecot.conf does.

dovecot at corwyn.net dovecot at corwyn.net
Wed Oct 8 03:03:54 EEST 2008




I'm having problems getting dovecot to set imap quotas that are 
defined as individual quotas for virtual users using mysql. I'm using 
postfix/dovecot 1.1.3, just built from source about a week ago.

I've been testing using telnet and getquotaroot. when I define the 
quota in dovecot.conf
   quota = dirsize
   quota_rule = *:storage=102400

I get the following response from Dovecot:

# telnet 127.0.0.1 143
Connected to 127.0.0.1.
* OK Dovecot ready.
. login test222 at example.com password
. OK Logged in.
. getquotaroot inbox
* QUOTAROOT "inbox" ""
* QUOTA "" (STORAGE 276273 102400)


All is good (the mailbox IS currently very full as part of my 
testing). However, when I define that data in the dovecot-sql.conf 
file, it doesn't appear to pick the data up, either as an override, 
or, if I delete
   quota_rule = *:storage=102400
from dovecot.conf, I get no quota at all
. getquotaroot inbox
. OK No quota.


# grep -v '^ *\(#.*\)\?$' dovecot-sql.conf
driver = mysql
connect = host=localhost dbname=postfix user=postfix password=password
default_pass_scheme = MD5-CRYPT
password_query = \
   SELECT username, domain, password \
   FROM mailbox WHERE username = '%u' AND domain = '%d' AND active = '1'
user_query = \
    SELECT 1015 as uid, 105 as gid, '/var/spool/mail/%d/%n' as home, \
    'maildir:/var/spool/mail/%d/%n/Maildir' as mail, \
    'dirsize' as quota, \
    concat('*:storage=', quota, 'B') as quota_rule, \
         FROM mailbox WHERE username = '%u' AND domain = '%d' and active = '1'


the results remain the same in telnet.


Any assistance would be appreciated. I've done a fair amount of 
digging, and have no idea why it's not working. ASsociated other 
configuration below.

Thanks!

Rick




SQL data:
mysql> show columns in mailbox;
+----------+--------------+------+-----+---------------------+-------+
| Field    | Type         | Null | Key | Default             | Extra |
+----------+--------------+------+-----+---------------------+-------+
| username | varchar(255) | NO   | PRI |                     |       |
| password | varchar(255) | NO   |     |                     |       |
| name     | varchar(255) | NO   |     | NULL                |       |
| maildir  | varchar(255) | NO   |     |                     |       |
| quota    | bigint(20)   | NO   |     | 0                   |       |
| domain   | varchar(255) | NO   |     |                     |       |
| created  | datetime     | NO   |     | 0000-00-00 00:00:00 |       |
| modified | datetime     | NO   |     | 0000-00-00 00:00:00 |       |
| active   | tinyint(1)   | NO   |     | 1                   |       |
+----------+--------------+------+-----+---------------------+-------+
9 rows in set (0.00 sec)


| test222 at example.com  | hashedpassword |              | 
example.com/test222/  | 153600000 | example.com | 2008-10-01 12:13:54 
| 2008-10-06 15:49:51 |      1 |




# dovecot -n
# 1.1.3: /usr/local/etc/dovecot.conf
protocols: imap imaps pop3 pop3s
ssl_disable: yes
ssl_cert_file: /etc/httpd/host.cert
ssl_key_file: /etc/httpd/host.key
disable_plaintext_auth: no
login_dir: /usr/local/var/run/dovecot/login
login_executable(default): /usr/local/libexec/dovecot/imap-login
login_executable(imap): /usr/local/libexec/dovecot/imap-login
login_executable(pop3): /usr/local/libexec/dovecot/pop3-login
mail_uid: 1015
mail_gid: 105
mail_location: maildir:/var/spool/mail/%d/%n/Maildir
mail_executable(default): /usr/local/libexec/dovecot/imap
mail_executable(imap): /usr/local/libexec/dovecot/imap
mail_executable(pop3): /usr/local/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota
mail_plugins(imap): quota imap_quota
mail_plugins(pop3): quota
mail_plugin_dir(default): /usr/local/lib/dovecot/imap
mail_plugin_dir(imap): /usr/local/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3
imap_client_workarounds(default): delay-newmail
imap_client_workarounds(imap): delay-newmail
imap_client_workarounds(pop3):
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
auth default:
   mechanisms: plain login
   passdb:
     driver: sql
     args: /usr/local/etc/dovecot-sql.conf
   userdb:
     driver: passwd
   userdb:
     driver: sql
     args: /usr/local/etc/dovecot-sql.conf
   userdb:
     driver: static
   socket:
     type: listen
     client:
       path: /var/run/dovecot/auth-client
       mode: 432
       user: vuser
       group: vuser
     master:
       path: /var/run/dovecot/auth-master
       mode: 384
       user: vuser
       group: vuser
plugin:
   quota: dirsize
   quota_rule: *:storage=102400
   quota_warning: storage=95%% /usr/local/sbin/quota_notify 95
   quota_warning2: storage=80%% /usr/local/sbin/quota_notify 80

Rick Steeves
http://www.sinister.net

"The journey is the destination"



More information about the dovecot mailing list