Hi,
I have dovecot configured to make use of the dict (mysql) plugin in order to keep track of the used quota. First, as you can see in the mysql table output below it seems that values aren't stored correctly. Secondly I get all kinds of database related errors in my mail logs. The (relevant) sections of the configuration files are also included below. My question is, what am I doing wrong?
Peter
mysql> select * from quota; +------------------+-------+---------+ | username | path | current | +------------------+-------+---------+ | userc@domain1 | 0 | 0 | | usera@domain1 | 0 | 0 | | userb@domain1 | 0 | 0 | | userb@domain1 | 5417 | 0 | | userb@domain1 | 937 | 0 | | userb@domain1 | 3724 | 0 | | userb@domain1 | -9141 | 0 | | userb@domain1 | 4887 | 0 | | userb@domain1 | -4887 | 0 | | usera@domain2 | 0 | 0 | | usera@domain1 | 3134 | 0 | | usera@domain1 | 2177 | 0 | | usera@domain1 | 5137 | 0 | | usera@domain1 | 4953 | 0 | +------------------+-------+---------+ 14 rows in set (0.03 sec)
dovecot.conf:
dict { quotadict = mysql:/usr/local/etc/dovecot/dovecot-dict-quota.conf }
plugin { quota = dict:storage=10240 proxy::quotadict }
dovecot-dict-quota.conf:
connect = host=localhost dbname=postfix user=postfix password=******* table = quota select_field = current where_field = path username_field = username
dovecot.log gives: Oct 02 23:25:49 Info: imap-login: Login: user=user@domain.net, method=plain, rip=88.211.149.123, lip=10.0.0.4, TLS Oct 02 23:25:49 Info: IMAP(user@domain.net): Effective uid=125, gid=125 Oct 02 23:25:49 Info: IMAP(user@domain.net): Loading modules from directory: /usr/local/lib/dovecot/imap Oct 02 23:25:49 Info: IMAP(user@domain.net): Module loaded: /usr/local/lib/dovecot/imap/lib01_quota_plugin.so Oct 02 23:25:49 Info: IMAP(user@domain.net): Module loaded: /usr/local/lib/dovecot/imap/lib02_imap_quota_plugin.so Oct 02 23:25:49 Info: IMAP(user@domain.net): Namespace: type=private, prefix=INBOX., sep=., inbox=yes, hidden=no, subscriptions=no Oct 02 23:25:49 Info: IMAP(user@domain.net): maildir: data=/data/postfix/virtual/domain.net/user Oct 02 23:25:49 Info: IMAP(user@domain.net): maildir: root=/data/postfix/virtual/domain.net/user, index=/data/postfix/virtual/domain.net/user, control=, inbox= Oct 02 23:25:49 Info: IMAP(user@domain.net): dict quota: uri = proxy::quotadict Oct 02 23:25:49 Info: IMAP(user@domain.net): dict quota: byte limit = 524288000 Oct 02 23:25:49 Info: IMAP(user@domain.net): dict quota: count limit = 0 Oct 02 23:25:49 Info: dict: mysql: Connected to localhost (postfix) Oct 02 23:25:55 Info: dict: mysql: Connected to localhost (postfix) Oct 02 23:25:56 Info: dict: mysql: Connected to localhost (postfix) Oct 02 23:26:37 Info: dict: mysql: Connected to localhost (postfix) Oct 02 23:27:07 Info: imap-login: Aborted login: rip=10.0.0.25, lip=10.0.0.22, TLS Oct 02 23:27:11 Info: dict: mysql: Connected to localhost (postfix)
mail.debug gives: Oct 2 23:26:39 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:39 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:39 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:39 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:40 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:40 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:40 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:40 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:40 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:40 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:40 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:42 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:42 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:42 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:48 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:48 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:48 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota
Hi,
I've had this problem as well. I brought it up about a month ago but nobody responded to my message.
There seems to be a problem in the SQL INSERT query in the source code. The ‘path’ value is being inserted into the ‘current’ column and via versa. I swapped them around in the source and recompiled it. That seemed to solve the insert problem, however there seems to be another issue I couldn’t solve when using multiple domains. Have a look at the message I posted last on this: http://www.dovecot.org/list/dovecot/2006-September/015970.html
This was all done on Dovecot version 1.0.rc6-1 from the Debian Testing package on a x86 machine. Does anyone know if this was fixed in rc7 or if anyone is working on it?
I’m afraid I'm not a C(++) coder so can’t really offer much more of an explanation on this.
Thanks Neil
Peter Veerman wrote:
Hi,
I have dovecot configured to make use of the dict (mysql) plugin in order to keep track of the used quota. First, as you can see in the mysql table output below it seems that values aren't stored correctly. Secondly I get all kinds of database related errors in my mail logs. The (relevant) sections of the configuration files are also included below. My question is, what am I doing wrong?
Peter
mysql> select * from quota; +------------------+-------+---------+ | username | path | current | +------------------+-------+---------+ | userc@domain1 | 0 | 0 | | usera@domain1 | 0 | 0 | | userb@domain1 | 0 | 0 | | userb@domain1 | 5417 | 0 | | userb@domain1 | 937 | 0 | | userb@domain1 | 3724 | 0 | | userb@domain1 | -9141 | 0 | | userb@domain1 | 4887 | 0 | | userb@domain1 | -4887 | 0 | | usera@domain2 | 0 | 0 | | usera@domain1 | 3134 | 0 | | usera@domain1 | 2177 | 0 | | usera@domain1 | 5137 | 0 | | usera@domain1 | 4953 | 0 | +------------------+-------+---------+ 14 rows in set (0.03 sec)
dovecot.conf:
dict { quotadict = mysql:/usr/local/etc/dovecot/dovecot-dict-quota.conf }
plugin { quota = dict:storage=10240 proxy::quotadict }
dovecot-dict-quota.conf:
connect = host=localhost dbname=postfix user=postfix password=******* table = quota select_field = current where_field = path username_field = username
dovecot.log gives: Oct 02 23:25:49 Info: imap-login: Login: user=user@domain.net, method=plain, rip=88.211.149.123, lip=10.0.0.4, TLS Oct 02 23:25:49 Info: IMAP(user@domain.net): Effective uid=125, gid=125 Oct 02 23:25:49 Info: IMAP(user@domain.net): Loading modules from directory: /usr/local/lib/dovecot/imap Oct 02 23:25:49 Info: IMAP(user@domain.net): Module loaded: /usr/local/lib/dovecot/imap/lib01_quota_plugin.so Oct 02 23:25:49 Info: IMAP(user@domain.net): Module loaded: /usr/local/lib/dovecot/imap/lib02_imap_quota_plugin.so Oct 02 23:25:49 Info: IMAP(user@domain.net): Namespace: type=private, prefix=INBOX., sep=., inbox=yes, hidden=no, subscriptions=no Oct 02 23:25:49 Info: IMAP(user@domain.net): maildir: data=/data/postfix/virtual/domain.net/user Oct 02 23:25:49 Info: IMAP(user@domain.net): maildir: root=/data/postfix/virtual/domain.net/user, index=/data/postfix/virtual/domain.net/user, control=, inbox= Oct 02 23:25:49 Info: IMAP(user@domain.net): dict quota: uri = proxy::quotadict Oct 02 23:25:49 Info: IMAP(user@domain.net): dict quota: byte limit = 524288000 Oct 02 23:25:49 Info: IMAP(user@domain.net): dict quota: count limit = 0 Oct 02 23:25:49 Info: dict: mysql: Connected to localhost (postfix) Oct 02 23:25:55 Info: dict: mysql: Connected to localhost (postfix) Oct 02 23:25:56 Info: dict: mysql: Connected to localhost (postfix) Oct 02 23:26:37 Info: dict: mysql: Connected to localhost (postfix) Oct 02 23:27:07 Info: imap-login: Aborted login: rip=10.0.0.25, lip=10.0.0.22, TLS Oct 02 23:27:11 Info: dict: mysql: Connected to localhost (postfix)
mail.debug gives: Oct 2 23:26:39 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:39 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:39 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:39 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:40 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:40 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:40 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:40 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:40 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:40 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:40 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:41 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:42 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:42 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:42 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:48 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:48 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota Oct 2 23:26:48 bubbles dovecot: IMAP(user@domain.net): dict_quota: Couldn't update quota
On Thu, 2006-10-05 at 11:57 +0100, Neil Smith wrote:
Hi,
I've had this problem as well. I brought it up about a month ago but nobody responded to my message.
There seems to be a problem in the SQL INSERT query in the source code.
I've done a couple of fixes since then. I think it should nowadays work. Check with rc8 after I release it.
Although I'd still have to add quota recalculation support for it..
Cool!
I will test it for sure and will report here.
Peter
Timo Sirainen wrote:
On Thu, 2006-10-05 at 11:57 +0100, Neil Smith wrote:
Hi,
I've had this problem as well. I brought it up about a month ago but nobody responded to my message.
There seems to be a problem in the SQL INSERT query in the source code.
I've done a couple of fixes since then. I think it should nowadays work. Check with rc8 after I release it.
Although I'd still have to add quota recalculation support for it..
Hi,
I have just compiled and ran dovecot rc9. The following error occured when moving a message:
"file mail-cache-transaction.c: line 709 (mail_cache_add): assertion failed: (fixed_size == (unsigned int)-1 || fixed_size == data_size)"
But this error is already fixxed in rc10 ?! (correct me if i'm wrong)
Then about quota dict mysql
I have checked mail for multiple accounts on my server and only one row is inserted in mysql:
username path current user@domain.tld quota/storage -162397
and that's it, while there are multiple accounts with different usernames..... THe current field is changed sometimes (don't know when) and appears to be changed into random values?
Peter
Timo Sirainen wrote:
On Thu, 2006-10-05 at 11:57 +0100, Neil Smith wrote:
Hi,
I've had this problem as well. I brought it up about a month ago but nobody responded to my message.
There seems to be a problem in the SQL INSERT query in the source code.
I've done a couple of fixes since then. I think it should nowadays work. Check with rc8 after I release it.
Although I'd still have to add quota recalculation support for it..
On Mon, 2006-10-16 at 13:09 +0200, Peter Veerman wrote:
"file mail-cache-transaction.c: line 709 (mail_cache_add): assertion failed: (fixed_size == (unsigned int)-1 || fixed_size == data_size)"
But this error is already fixxed in rc10 ?! (correct me if i'm wrong)
Yep.
I have checked mail for multiple accounts on my server and only one row is inserted in mysql:
username path current user@domain.tld quota/storage -162397
and that's it, while there are multiple accounts with different usernames..... THe current field is changed sometimes (don't know when) and appears to be changed into random values?
I think your database table is created wrong. The primary key was described wrong in the wiki before. Recreate it so it's the same as in http://wiki.dovecot.org/Quota/Dict
Okay,
As i am sure that i created the table with the same sql code from the same wiki...... i dropped and recreated the table, restarted dovecot and it worked..... the only thing is that current remains 0 but that is what you predicted as you mailed 9-10 10:24:
"Although I'd still have to add quota recalculation support for it.."
grtz
Peter
Timo Sirainen wrote:
On Mon, 2006-10-16 at 13:09 +0200, Peter Veerman wrote:
"file mail-cache-transaction.c: line 709 (mail_cache_add): assertion failed: (fixed_size == (unsigned int)-1 || fixed_size == data_size)"
But this error is already fixxed in rc10 ?! (correct me if i'm wrong)
Yep.
I have checked mail for multiple accounts on my server and only one row is inserted in mysql:
username path current user@domain.tld quota/storage -162397
and that's it, while there are multiple accounts with different usernames..... THe current field is changed sometimes (don't know when) and appears to be changed into random values?
I think your database table is created wrong. The primary key was described wrong in the wiki before. Recreate it so it's the same as in http://wiki.dovecot.org/Quota/Dict
participants (3)
-
Neil Smith
-
Peter Veerman
-
Timo Sirainen