[Dovecot] Vpopmail Dynamic Authentication Module
Hello,
We currently use qmail with vpopmail for e-mail and are looking to switch from courier-imap to dovecot for IMAP on our RedHat EL 5 systems. Our goal is to use the dovecot RPM supplied by RH (v1.0.7) if at all possible. We can do this if we are able to dynamically load the vpopmail auth module.
The wiki (http://wiki.dovecot.org/CompilingSource) notes that this should be possible:
Dovecot can also dynamically load authentication modules from the $prefix/lib/dovecot/auth/ directory. Binary packages builders should use them for authentication modules which require external libraries (e. g. LDAP and vpopmail). There is no standard way to build them as modules currently, but something like this should work:
gcc -shared -fPIC -DHAVE_CONFIG_H -DUSERDB_VPOPMAIL -DPASSDB_VPOPMAIL \-I../.. -I../lib userdb-vpopmail.c passdb-vpopmail.c -o vpopmail.so \-lvpopmail
I had to modify the command to build the module, but was able to successfully build it: gcc -shared -fPIC -DHAVE_CONFIG_H -DUSERDB_VPOPMAIL -DPASSDB_VPOPMAIL -I../.. -I../lib -I/home/vpopmail/include -I/home/vpopmail/lib userdb-vpopmail.c passdb-vpopmail.c -o vpopmail.so -L/home/vpopmail/lib/libvpopmail.a
I am unable to get the module to load properly. Dovecot built with --with-vpopmail works perfectly. When I start dovecot and it tries to load the module it reports: Aug 23 16:48:18 ctd-nix1 dovecot: Dovecot v1.0.7 starting up Aug 23 16:48:18 ctd-nix1 dovecot: auth(default): dlopen(/usr/lib64/dovecot/auth/vpopmail.so) failed: /usr/lib64/dovecot/auth/vpopmail.so: undefined symbol: vclose Aug 23 16:48:18 ctd-nix1 dovecot: auth(default): dlsym(passdb_vpopmail) failed: dovecot-auth: undefined symbol: passdb_vpopmail Aug 23 16:48:18 ctd-nix1 dovecot: auth(default): Unknown passdb driver 'vpopmail' (typo, or Dovecot was built without support for it? Check with dovecot --build-options) Aug 23 16:48:18 ctd-nix1 dovecot: Auth process died too early - shutting down
Sometimes instead the last line is replaced with: Aug 23 15:02:45 ctd-nix1 dovecot: child 5412 (auth) returned error 89
Thanks!
Eric
On 24.8.2012, at 16.42, Eric Sisolak wrote:
I had to modify the command to build the module, but was able to successfully build it: gcc -shared -fPIC -DHAVE_CONFIG_H -DUSERDB_VPOPMAIL -DPASSDB_VPOPMAIL -I../.. -I../lib -I/home/vpopmail/include -I/home/vpopmail/lib userdb-vpopmail.c passdb-vpopmail.c -o vpopmail.so -L/home/vpopmail/lib/libvpopmail.a
-L means a path, pointing it to .a file doesn't do anything useful. By giving the .a file directly probably also fails if libvpopmail.a hasn't been built with -fPIC.
/usr/lib64/dovecot/auth/vpopmail.so: undefined symbol: vclose
And that's the reason this fails, because libvpopmail isn't included in vpopmail.so.
On Fri, Aug 31, 2012 at 9:49 AM, Timo Sirainen tss@iki.fi wrote:
On 24.8.2012, at 16.42, Eric Sisolak wrote:
I had to modify the command to build the module, but was able to successfully build it: gcc -shared -fPIC -DHAVE_CONFIG_H -DUSERDB_VPOPMAIL -DPASSDB_VPOPMAIL -I../.. -I../lib -I/home/vpopmail/include -I/home/vpopmail/lib userdb-vpopmail.c passdb-vpopmail.c -o vpopmail.so -L/home/vpopmail/lib/libvpopmail.a
-L means a path, pointing it to .a file doesn't do anything useful. By giving the .a file directly probably also fails if libvpopmail.a hasn't been built with -fPIC.
/usr/lib64/dovecot/auth/vpopmail.so: undefined symbol: vclose
And that's the reason this fails, because libvpopmail isn't included in vpopmail.so.
Ah that was it, I was misunderstanding -l and -L. I got it to work with: gcc -shared -fPIC -DHAVE_CONFIG_H -DUSERDB_VPOPMAIL -DPASSDB_VPOPMAIL -I../.. -I../lib -I/home/vpopmail/include -L/home/vpopmail/lib userdb-vpopmail.c passdb-vpopmail.c -o vpopmail.so -lvpopmail
Thanks!
participants (2)
-
Eric Sisolak
-
Timo Sirainen