[Dovecot] quota in mysql not being updated
I'm having trouble getting the quota plugin to work with deliver. The quota in the database is not getting set.
I am using dovecot-1.0-rc15. This server is not yet in production. Some values below are because I'm trying to test with the simplest possible case, and some because it's reading from a different database. Also, I noticed that "dovecot -n" doesn't display any information for the lda, nor any plugin information.
Entries from /etc/dovecot/dovecot.conf: protocol lda { ... mail_plugins = quota }
auth default { .... userdb sql { args = /etc/dovecot/dovecot-sql.conf } }
dict { quotadict = mysql:/etc/dovecot/dict-quota.conf }
plugin { quota = dict:storage=1024000: proxy::quotadict }
from dovecot-sql.conf: user_query = SELECT 225 as uid, 225 as gid, mailbox_path as home, mailbox_path as mail, 'dirsize:storage=10240:messages=1000' as quota FROM transports WHERE email = '%u'
dict-quota.conf: connect = ... table = quota_used select_field = quota_used_kb where_field = quota_type username_field = username_and_realm
in mysql: describe quota_used; +--------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------------+--------------+------+-----+---------+-------+ | username_and_realm | varchar(255) | NO | PRI | | | | quota_type | varchar(255) | NO | PRI | | | | quota_used_kb | int(11) | NO | | 0 | | +--------------------+--------------+------+-----+---------+-------+
mail logs: Jan 7 22:13:46 sentinel deliver(test.marshal@acd.net): auth input: test.marshal@acd.net Jan 7 22:13:46 sentinel deliver(test.marshal@acd.net): auth input: uid=225 Jan 7 22:13:46 sentinel deliver(test.marshal@acd.net): auth input: gid=225 Jan 7 22:13:46 sentinel deliver(test.marshal@acd.net): auth input: home=/var/mail/vmail01/00/00000001 Jan 7 22:13:46 sentinel deliver(test.marshal@acd.net): auth input: mail=/var/mail/vmail01/00/00000001 Jan 7 22:13:46 sentinel deliver(test.marshal@acd.net): auth input: quota=maildir:storage=1048576 Jan 7 22:13:46 sentinel deliver(test.marshal@acd.net): Loading modules from directory: /usr/lib/dovecot/lda Jan 7 22:13:46 sentinel deliver(test.marshal@acd.net): Module loaded: /usr/lib/dovecot/lda/lib01_quota_plugin.so Jan 7 22:13:46 sentinel deliver(test.marshal@acd.net): maildir: data=/var/mail/vmail01/00/00000001 Jan 7 22:13:46 sentinel deliver(test.marshal@acd.net): maildir: root=/var/mail/vmail01/00/00000001, index=/var/mail/vmail01/00/00000001, control=, inbox= Jan 7 22:13:46 sentinel deliver(test.marshal@acd.net): msgid=20070107221155.0db93ce6@localhost: saved mail to INBOX
-- Marshal Newrock Ideal Solution, LLC - http://www.idealso.com
On 8.1.2007, at 6.11, Marshal Newrock wrote:
plugin { quota = dict:storage=1024000: proxy::quotadict }
So, dict in here.
from dovecot-sql.conf: user_query = SELECT 225 as uid, 225 as gid, mailbox_path as home, mailbox_path as mail, 'dirsize:storage=10240:messages=1000' as quota FROM transports WHERE email = '%u'
dirsize in here.
Jan 7 22:13:46 sentinel deliver(test.marshal@acd.net): auth input: quota=maildir:storage=1048576
And maildir in here.
Completely inconsistent. :)
(Resent from the correct address. If this is an indication of how my day will be going, I should go back to bed.)
Let's try this again, a little simpler. And making sure all the information is correct and up to date. I eliminated setting the quota from the userdb query.
dovecot.conf: plugins { quota = dict:storage=10240:messages=1000 mysql:/etc/dovecot/dict-quota.conf } (quota is all on one line, though)
dovecot-sql.conf: user_query = SELECT 225 as uid, 225 as gid, mailbox_path as home, mailbox_path as mail FROM transports WHERE email = '%u'
The log says: Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): auth input: test.marshal@acd.net Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): auth input: uid=225 Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): auth input: gid=225 Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): auth input: home=/var/mail/vmail01/00/00000001 Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): auth input: mail=/var/mail/vmail01/00/00000001 Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): Loading modules from directory: /usr/lib/dovecot/lda Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): Module loaded: /usr/lib/dovecot/lda/lib01_quota_plugin.so Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): maildir: data=/var/mail/vmail01/00/00000001 Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): maildir: root=/var/mail/vmail01/00/00000001, index=/var/mail/vmail01/00/00000001, control=, inbox= Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): dict quota: uri = mysql:/etc/dovecot/dict-quota.conf Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): dict quota: byte limit = 1000 Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): dict quota: count limit = 0 Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): Unknown dict module: mysql Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): dict quota: dict_init() failed
# dovecot --build-options Build options: ioloop=epoll notify=dnotify openssl SQL drivers: mysql Passdb: checkpassword ldap pam passwd passwd-file shadow sql Userdb: checkpassword ldap passwd prefetch passwd-file sql static
-- Marshal Newrock Ideal Solution, LLC - http://www.idealso.com
On 8.1.2007, at 16.02, Marshal Newrock wrote:
Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): Unknown dict module: mysql
OK, here's the problem. I didn't want to link SQL libraries to
deliver, imap and pop3 binaries so you can't use the dict=mysql
directly. So do it via dict proxy, like http://wiki.dovecot.org/Quota/
Dict explains. I guess I'll have to update the page to mention that
it won't really even work currently without the proxy.. :)
On Mon, 8 Jan 2007 17:13:53 +0200 Timo Sirainen tss@iki.fi wrote:
On 8.1.2007, at 16.02, Marshal Newrock wrote:
Jan 8 08:45:07 sentinel deliver(test.marshal@acd.net): Unknown dict module: mysql
OK, here's the problem. I didn't want to link SQL libraries to
deliver, imap and pop3 binaries so you can't use the dict=mysql
directly. So do it via dict proxy, like http://wiki.dovecot.org/Quota/ Dict explains. I guess I'll have to update the page to mention that it won't really even work currently without the proxy.. :)
I've made that change. Now I have:
plugin { quota = dict:storage=10240:messages=1000 proxy::quotadict }
dict { quotadict = mysql:/etc/dovecot/dict-quota.conf }
In the logs: Jan 8 12:52:22 sentinel deliver(test.marshal@acd.net): dict quota: uri = proxy::quotadict Jan 8 12:52:22 sentinel deliver(test.marshal@acd.net): dict quota: byte limit = 1000 Jan 8 12:52:22 sentinel deliver(test.marshal@acd.net): dict quota: count limit = 0
thus creating a bounce. I am confused.
On the plus side, I upgraded to 1.0-rc17, and on the imap side of things, quota appears to be working fine.
-- Marshal Newrock, Ideal Solution LLC http://www.idealso.com
On Mon, 2007-01-08 at 13:12 -0500, Marshal Newrock wrote:
quota = dict:storage=10240:messages=1000 proxy::quotadict
..
Jan 8 12:52:22 sentinel deliver(test.marshal@acd.net): dict quota: byte limit = 1000 Jan 8 12:52:22 sentinel deliver(test.marshal@acd.net): dict quota: count limit = 0
Fixed: http://dovecot.org/list/dovecot-cvs/2007-January/007463.html
participants (2)
-
Marshal Newrock
-
Timo Sirainen