David Jonas
2006-Jul-28 22:56 UTC
[Dovecot] Quota with dict backend - sql does not get registered
Hello everyone, I've been working with the quota plugin, attempting to use the dict backend. It seems the sql dict class is not getting loaded. I dropped a couple lines in dict_class_lookup(dict.c) and it seems the only class that gets loaded is "proxy". Any idea how to get the sql driver to load in the quota/dict module? My authentication goes through the sql module and is working perfectly, so I know that the module and db are talking in general. I've scoured the documentation and dug through the code but I can't seem to discover the solution. There is "Dynamic SQL drivers" in the compiling from source section: http://wiki.dovecot.org/CompilingSource#line-158 I compiled the driver_mysql.so, copied it to lib/dovecot/, symlinked it into auth/, imap/, pop3/ and lda/, then tried-- but it still only showed "proxy" as being loaded. After that I added it to the mail_plugins list, mail_plugins = driver_mysql quota but it didn't like that and spat out some linking errors: Edlopen(/usr/local/dovecot-1.0.rc2/lib/dovecot/imap/driver_mysql.so) failed: /usr/local/dovecot-1.0.rc2/lib/dovecot/imap/driver_mysql.so: undefined symbol: sql_not_connected_result So, where do I go from here? Any insights would be appreciated and I'll keep digging. Regards, David
David Jonas
2006-Jul-31 19:19 UTC
[Dovecot] Quota with dict backend - sql does not get registered
On Fri, 2006-07-28 at 15:56 -0700, David Jonas wrote:> Hello everyone, > > I've been working with the quota plugin, attempting to use the dict > backend. It seems the sql dict class is not getting loaded. I dropped a > couple lines in dict_class_lookup(dict.c) and it seems the only class > that gets loaded is "proxy". Any idea how to get the sql driver to load > in the quota/dict module?I added the code to load the driver in src/imap/main.c following the example from dict-client registration. Modified the Makefile, etc, got it to compile. But it seg faults when imap is run. Traced it to src/lib-dict/dict-sql.c: /* @UNSAFE */ drivers = array_get(&sql_drivers, &count); dict_sql_classes = i_new(struct dict, count + 1); So, the comments don't lie. It is unsafe. Looks like that is why the dict-server is the default with the proxy backend only. I guess I'll poke around more. Advice on how to skirt this would be appreciated. Was all this already talked about on the list, hence no reply? I couldn't find anything... David