mikael
2006-Jul-23 11:51 UTC
[Dovecot] Try with Dictionary proxy server, but... Bug or not ?
Hello again :), I try to use dictionary proxy server to replace my precedent configuration (direct use of dict in plugin quota). Before, i have this configuration in my dovecot.conf : ## Dictionary server settings dict { } ## Plugin settings plugin { # quota = 10 Mo quota = dict:storage=10240 mysql:/etc/dovecot/dict-quota.conf } And after, to use proxy, I have this configuration in my dovecot.conf : ## Dictionary server settings dict { quota = mysql:/etc/dovecot/dict-quota.conf } ## Plugin settings plugin { # quota = 10 Mo quota = dict:storage=10240 proxy::quota } My dict-quota.conf doesn't change : connect = host=localhost dbname=dovecot user=dovecot table = quota select_field = current where_field = path username_field = username My dovecot.info file : dovecot: 2006-07-23 15:07:01 Info: IMAP(test): Effective uid=1019, gid=1019 dovecot: 2006-07-23 15:07:01 Info: IMAP(test): Loading modules from directory: /usr/lib/dovecot/modules/imap dovecot: 2006-07-23 15:07:01 Info: IMAP(test): Module loaded: /usr/lib/dovecot/modules/imap/lib01_quota_plugin.so dovecot: 2006-07-23 15:07:01 Info: IMAP(test): Module loaded: /usr/lib/dovecot/modules/imap/lib02_imap_quota_plugin.so dovecot: 2006-07-23 15:07:01 Info: IMAP(test): maildir: data=/home/test/Mail dovecot: 2006-07-23 15:07:01 Info: IMAP(test): maildir: root=/home/test/Mail, index=/home/test/Mail, control=, inboxdovecot: 2006-07-23 15:07:01 Info: IMAP(test): dict quota: uri = proxy::quota dovecot: 2006-07-23 15:07:01 Info: IMAP(test): dict quota: byte limit = 10485760 dovecot: 2006-07-23 15:07:01 Info: IMAP(test): dict quota: count limit = 0 dovecot: 2006-07-23 15:07:01 Info: imap-login: Login: user=<test>, method=plain, rip=82.228.176.60, lip=192.168.1.60 When i use the proxy configuration, i have this error : dovecot: 2006-07-23 15:07:51 Error: dict: sql dict: commit failed: Not connected to database dovecot: 2006-07-23 15:07:51 Error: IMAP(test): dict_quota: Couldn't update quota dovecot: 2006-07-23 15:07:51 Error: dict: sql dict: commit failed: Not connected to database dovecot: 2006-07-23 15:07:51 Error: IMAP(test): dict_quota: Couldn't update quota dovecot: 2006-07-23 15:07:51 Error: dict: sql dict: commit failed: Not connected to database dovecot: 2006-07-23 15:07:51 Error: IMAP(test): dict_quota: Couldn't update quota dovecot: 2006-07-23 15:07:52 Error: dict: sql dict: commit failed: Not connected to database dovecot: 2006-07-23 15:07:52 Error: IMAP(test): dict_quota: Couldn't update quota And in MySQL log : 060723 15:07:01 460 Connect Acc?s refus? pour l'utilisateur: 'dovecot'@'@localhost' (mot de passe: NON) 060723 15:07:45 461 Connect Acc?s refus? pour l'utilisateur: 'dovecot'@'@localhost' (mot de passe: NON) It try to connect with 'dovecot'@'@localhost'... But it will be 'dovecot'@'localhost'. No ? Thanks for your help, -- Mika?l,
mikael
2006-Jul-23 21:41 UTC
[Dovecot] Try with Dictionary proxy server, but... Bug or not ?
mikael a ?crit :> And in MySQL log : > > 060723 15:07:01 460 Connect Acc?s refus? pour l'utilisateur: > 'dovecot'@'@localhost' (mot de passe: NON) > 060723 15:07:45 461 Connect Acc?s refus? pour l'utilisateur: > 'dovecot'@'@localhost' (mot de passe: NON) > > > It try to connect with 'dovecot'@'@localhost'... But it will be > 'dovecot'@'localhost'. No ?I find my error : My mysql user ('dovecot') has a pasword :D So i have modified my "dict-quota.conf" file like this (add the password value) : connect = host=localhost dbname=dovecot user=dovecot password=<MYPASSWORD> table = quota select_field = current where_field = path username_field = username And I have modified the password field in mysql.user table (MySQL version 5) to use old style password (dovecot use old style ? dovecot can't connect without the use of old style) : mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('<MYPASSWORD>')WHERE User='dovecot'; mysql> FLUSH PRIVILEGES; And it works... In fact, i have only connexion... I can't really use quota :'( Now, I have another problem : i use the proxy conf with dict, and i have two mail accounts (system) "user1" and "user2". When i use thunderbird to read user1 mailbox, the first query to det quota is with the username "user1". It's OK : 492 Query SELECT current FROM quota WHERE path = 'quota/storage' AND username = 'user1' 492 Query BEGIN;INSERT INTO quota (current, path, username) VALUES ('quota/storage', 0, 'user1') ON DUPLICATE KEY UPDATE current = current + 0;COMMIT I don't understant the second query "BEGIN;...;COMMIT". what is the role of this query ? But the "INSERT" is it OK ? I think it will be "INSERT INTO quota (path, current, username)" and not "INSERT INTO quota (current, path, username)", because path is a varchar(255) ('quota/storage') and current is an integer (0). No ? My real problem isn't here... When i would like to read the user2 mailbox, the query to get the user2 quota is the same that the query for user1 !? For my user2, the query is : 492 Query SELECT current FROM quota WHERE path = 'quota/storage' AND username = 'user1' 492 Query BEGIN;INSERT INTO quota (current, path, username) VALUES ('quota/storage', 0, 'user1') ON DUPLICATE KEY UPDATE current = current + 0;COMMIT When i restart Thunderbird and read first the user2 mailbox, the query is : 492 Query SELECT current FROM quota WHERE path = 'quota/storage' AND username = 'user2' 492 Query BEGIN;INSERT INTO quota (current, path, username) VALUES ('quota/storage', 0, 'user2') ON DUPLICATE KEY UPDATE current = current + 0;COMMIT And this query is for user2 and user1 !.. How the dovecot quota mechanism works with dict ??? Thanks, -- Mika?l,
mikael
2006-Jul-23 21:49 UTC
[Dovecot] Try with Dictionary proxy server, but... Bug or not ?
I forget to tell that only proxy dict configuration works for me... When I try this type of configuration in plugin{} block : quota = dict:storage=10240 mysql:/etc/dovecot/dict-quota.conf I have this error : dovecot: Error: IMAP(test): Unknown dict module: mysql dovecot: Error: child 4457 (imap) killed with signal 11 ... dovecot: Error: IMAP(test): Unknown dict module: mysql dovecot: Error: child 4457 (imap) killed with signal 11 And the connexion start, stop, start, stop etc etc etc until I stop dovecot. -- Mika?l,