[Dovecot] using mysql from within a plugin

Timo Sirainen tss at iki.fi
Thu Apr 24 16:26:48 EEST 2008


On Sun, 2008-04-20 at 00:36 +0200, Alexander Prinsier wrote:
> Hello,
> 
> I'm trying to access a mysql database in a plugin.
> 
> -What special compiler flags do I need? I discovered that when I don't
> explicitly link lib-sql/libsql.a in, then I get an undefind symbol error
> about sql_init when loading the plugin.

Right. Also you need the mysql libraries linked with it.

> Shouldn't the imap process itself have sql support linked in, rather
> than each plugin?

It could, but since IMAP normally doesn't need SQL it would just be
extra bloat and slower startup time for >99% of users. That's one of the
main reasons why dict-proxy exists, so that SQL support can be linked
only to dict process and used by IMAP plugins via the proxy.

I think it would be possible to create a SQL plugin though, which
contains lib-sql.a and the sql libraries linked to it as well. Although
that would require changes to lib-sql also so that it would build a .la
library out of it.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20080424/f433b803/attachment-0001.bin 


More information about the dovecot mailing list