I maintain a software stack consisting of Perl and Cyrus IMAP among other things.
Perl seems to be working fine and Cyrus cyradm (a perl script) works fine too. However, sieveshell will not execute and reason for asking for help here.
When I run sieveshell, I get the follow output:
Can't load '/usr/local/pozix/perl-5.10.0/lib/site_perl/5.10.0/i686-linux-thread-multi/auto/Cyrus/SIEVE/managesieve/managesieve.so' for module Cyrus::SIEVE::managesieve: /usr/local/pozix/perl-5.10.0/lib/site_perl/5.10.0/i686-linux-thread-multi/auto/Cyrus/SIEVE/managesieve/managesieve.so: undefined symbol: PQfinish at /usr/local/pozix/perl-5.10.0/lib/5.10.0/i686-linux-thread-multi/DynaLoader.pm line 203. at ./sieveshell line 45 Compilation failed in require at ./sieveshell line 45. BEGIN failed--compilation aborted at ./sieveshell line 45.
PQfinish is part of the PostgreSQL libraries. If I run ldd on managesieve.so, the PGSQL libs are not linked in however, there are no missing libraries either. If I run ldd on libsasl2 library listed, it looks OK too and it does use PGSQL but it is apparently not part of the library linked to managesieve.so. Moreover, libsasl2 is working fine when used by other software.
Here is ldd managesieve.so
linux-gate.so.1 => (0xffffe000)
libdb-4.4.so => /lib/libdb-4.4.so (0xb7f8a000)
libsasl2.so.2 => /usr/local/pozix/cyrus-sasl/lib/libsasl2.so.2 (0xb7f74000)
libssl.so.0 => /usr/lib/libssl.so.0 (0xb7f33000)
libcrypto.so.0 => /usr/lib/libcrypto.so.0 (0xb7df6000)
libc.so.6 => /lib/libc.so.6 (0xb7caa000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7c92000)
libdl.so.2 => /lib/libdl.so.2 (0xb7c8e000)
libresolv.so.2 => /lib/libresolv.so.2 (0xb7c7b000)
/lib/ld-linux.so.2 (0xb80aa000)
ldd usr/local/pozix/cyrus-sasl/lib/libsasl2.so.2
linux-gate.so.1 => (0xffffe000)
libdl.so.2 => /lib/libdl.so.2 (0xb7f0a000)
libresolv.so.2 => /lib/libresolv.so.2 (0xb7ef7000)
libc.so.6 => /lib/libc.so.6 (0xb7dab000)
/lib/ld-linux.so.2 (0xb7f34000)
There are no compilation errors during the building of Cyrus IMAP either. I suspect this could be a path problem but not sure where to look or debug the path output or where to go next on this.
Tried googling for this and got a couple hits but they either had no solution or didn't work for me. I suspect the Perl AUTOLOAD is confused in some way. DBD::Pg appears to be working as well; using version 2.15.1.
Any suggestions on where to go next? Any Perl gurus out there?
SOLVED!
./configure builds the Makefiles in each sub-directory. The managesieve.so library is created with a call from Perl... I.E. Perl Makefile.PL resulting in a Makefile. Andrew's advise helped immensely in tracking this down. In the Makefile there are the following lines:
EXTRALIBS = -ldb-4.4 -L/usr/local/pozix/cyrus-sasl/lib -lsasl2 -lssl -lcrypto
LDLOADLIBS = -ldb-4.4 -L/usr/local/pozix/cyrus-sasl/lib -lsasl2 -lssl -lcrypto
Which I updated to read:
EXTRALIBS = -ldb-4.4 -L/usr/local/pozix/cyrus-sasl/lib -L/usr/local/pozix/pgsql/lib -lsasl2 -lssl -lcrypto -lpq
LDLOADLIBS = -ldb-4.4 -L/usr/local/pozix/cyrus-sasl/lib -L/usr/local/pozix/pgsql/lib -lsasl2 -lssl -lcrypto -lpq
And this solved it!
Sounds like you need to re-compile the sieve shared library and include the -lPGSql (or whatever). Is there a configure script that you need to add a '--with-postgres' to? If not, you may have to manually edit the Makefile (or Makefile.PL, or Build.PL).