OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Compiling problems - Dovecot SASL + SSL/TLS

From: Stephen McHenry (stephen.mchenrygmail.com)
Date: Tue Jan 01 2008 - 18:16:39 CST


I've been trying to do a fairly major upgrade to our mail servers,
switching to Dovecot (IMAP+SSL) and adding both SASL (we previously
used POP before SMTP) and SSL/TLS to Postfix (not trying to do
anything overly complicated with the TLS - just trying to avoid
sending AUTH passwords in the clear). The Dovecot part works fine. On
the Postfix side, I tried a "small steps" approach, first adding SASL,
and then adding TLS to that. The SASL part works fine. Compiles,
installs, works great.

When I went to add the SSL/TLS part, I did (per the instructions) a
"make tidy" followed by:

make makefiles CCARGS="-DUSE_SASL_AUTH
-DDEF_SERVER_SASL_TYPE=\"dovecot\" -DUSE_TLS -I/usr/local/include" \
    AUXLIBS="-L/usr/local/lib -lssl -lcrypto"

to rebuild the makefiles. (OpenSSL is in /usr/local/openssl with a
symlink from /usr/local/include.)

When I recompile, I get the undefined error shown below.

[src/smtpd]
gcc -Wmissing-prototypes -Wformat -DUSE_SASL_AUTH
-DDEF_SERVER_SASL_TYPE="dovecot" -DUSE_TLS -I/usr/local/include
-DHAS_PCRE -g -O -I. -I../../include -DLINUX2 -c smtpd.c
smtpd.c: In function 'main':
smtpd.c:4580: error: 'dovecot' undeclared (first use in this function)
smtpd.c:4580: error: (Each undeclared identifier is reported only once
smtpd.c:4580: error: for each function it appears in.)
make: *** [smtpd.o] Error 1

Just for reference, I went back to see if I could get just SSL/TLS
working (w/o the SASL part). That also had problems.

gcc -Wmissing-prototypes -Wformat -DUSE_TLS -I/usr/local/include
-DHAS_PCRE -g -O -I. -I../../include -DLINUX2 -o smtpd smtpd.o
smtpd_token.o smtpd_check.o smtpd_chat.o smtpd_state.o smtpd_peer.o
smtpd_sasl_proto.o smtpd_sasl_glue.o smtpd_proxy.o smtpd_xforward.o
smtpd_dsn_fix.o smtpd_milter.o ../../lib/libmaster.a
../../lib/libtls.a ../../lib/libdns.a ../../lib/libxsasl.a
../../lib/libmilter.a ../../lib/libglobal.a ../../lib/libutil.a
-L/usr/local/lib -lssl -lcrypto -L/usr/lib -lpcre -ldb -lnsl -lresolv
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function
`dlfcn_bind_func':dso_dlfcn.c:(.text+0x27d): undefined reference to
`dlsym'
:dso_dlfcn.c:(.text+0x2f9): undefined reference to `dlerror'
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function
`dlfcn_bind_var':dso_dlfcn.c:(.text+0x36d): undefined reference to
`dlsym'
:dso_dlfcn.c:(.text+0x3e1): undefined reference to `dlerror'
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function
`dlfcn_unload':dso_dlfcn.c:(.text+0x44c): undefined reference to
`dlclose'
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function
`dlfcn_load':dso_dlfcn.c:(.text+0x4f5): undefined reference to
`dlopen'
:dso_dlfcn.c:(.text+0x546): undefined reference to `dlclose'
:dso_dlfcn.c:(.text+0x56f): undefined reference to `dlerror'
collect2: ld returned 1 exit status

This one appears to be a library that's not getting picked up, but
it's not clear which one (and I'm guessing that the first problem is
going to hit this one as soon as I get past the compile issue). OS is
Fedora 5, and the sources were untarred under /usr/local/src/postfix.

I'm thinking this is something really obvious that I'm just missing
(more sleep!), but I'm just not seeing it right now. Any help would be
appreciated. Thanks in advance...

--
Stephen