atom feed5 messages in net.sourceforge.lists.courier-usersRe: [courier-users] Courier-Imap + Vp...
FromSent OnAttachments
Daniel BiddleMar 17, 2001 5:51 am 
Daniel BiddleMar 17, 2001 5:52 am 
Daniel BiddleMar 17, 2001 5:53 am 
Daniel BiddleMar 17, 2001 5:53 am 
Daniel BiddleMar 17, 2001 5:54 am 
Subject:Re: [courier-users] Courier-Imap + Vpopmail +MySQL (not the usual question) (fwd)
From:Daniel Biddle (del@osian.net)
Date:Mar 17, 2001 5:53:51 am
List:net.sourceforge.lists.courier-users

---------- Forwarded message ---------- Date: Sat, 17 Mar 2001 11:44:34 -0000 From: Don Hinshaw <dw@kaltobepress.com> To: Daniel Biddle <del@osian.net> Subject: Re: [courier-users] Courier-Imap + Vpopmail +MySQL (not the usual question)

Daniel Biddle <del@osian.net> said:

strace -p $(cat /var/run/imapd.pid) -f -t -o imapd.strace hope this helps,

It certainly does, you rock. Lo and behold:

9129 01:38:55 open("/var/qmail/vpopmail/domains/bs.com/vpasswd.cdb", O_RDONLY) = -1 ENOENT (No such file or directory) 9129 01:38:55 open("/var/qmail/vpopmail/domains/bs.com/.vpasswd.lock", O_RDWR|O_CREAT|O_TRUNC, 0666) = 4 9129 01:38:55 fcntl(4, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = -1 EINVAL (Invalid argument) 9129 01:38:55 open("/var/qmail/vpopmail/domains/bs.com/vpasswd", O_RDONLY) = -1 ENOENT (No such file or directory) 9129 01:38:55 fcntl(4, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = -1 EINVAL (Invalid argument) 9129 01:38:55 close(4) = 0 9129 01:38:55 open("/var/qmail/vpopmail/domains/bs.com/vpasswd.cdb", O_RDONLY) = -1 ENOENT (No such file or directory)

Which explains what I mentioned in my first post, that a .vpasswd.lock was created where there was no .vpasswd.cdb file. Courier-Imap is still trying to auth from the vpasswd files. So my guess about that was correct.

Now, when I first tried to compile it, it bitched about the call to the mysql_functions (as mentioned in several posts on this list), so I compiled it like this:

rpm -Uvh MySQL-client-3.23.34-1.i386.rpm rpm -Uvh MySQL-devel-3.23.34-1.i386.rpm rpm -Uvh MySQL-shared-3.23.34-1.i386.rpm

CPPFLAGS="-I/usr/include/mysql" LDFLAGS="-L/usr/lib/mysql" ``env LIBS="-L/usr/lib/mysql -lmysqlclient -lz"'' ./configure -- prefix=/var/qmail/courier-imap make

Which I thought was in accordance with all the tips that I read on the the list. Did I compile it wrong? Perhaps, I am a bit of an idiot in the wee hours. I notice that I didn't do:

export CPPFLAGS export LDFLAGS

As specified in the FAQ. According to .bash_history, I had done this every other time except this last time so...

I just now did:

CPPFLAGS="-I/usr/include/mysql" LDFLAGS="-L/usr/lib/mysql" export CPPFLAGS export LDFLAGS /configure --prefix=/var/qmail/courier-imap

(in accordance with the FAQ)

and make fails with:

undefined reference to `mysql_init' (etc etc etc).

So, I wipe and unpack it again, and try it this way:

[root@w1 qmail]# ls -al /usr/lib/libmysql* lrwxrwxrwx 1 root root 24 Mar 15 19:06 /usr/lib/libmysqlclient.so -> libmysqlclient.so.10.0.0 lrwxrwxrwx 1 root root 24 Mar 15 19:06 /usr/lib/libmysqlclient.so.10 -> libmysqlclient.so.10.0.0 -rwxr-xr-x 1 root root 217861 Mar 10 08:09 /usr/lib/libmysqlclient.so.10.0.0 lrwxrwxrwx 1 root root 26 Mar 15 19:06 /usr/lib/libmysqlclient_r.so -> libmysqlclient_r.so.10.0.0 lrwxrwxrwx 1 root root 26 Mar 15 19:06 /usr/lib/libmysqlclient_r.so.10 -> libmysqlclient_r.so.10.0.0 -rwxr-xr-x 1 root root 217925 Mar 10 08:07 /usr/lib/libmysqlclient_r.so.10.0.0 [root@w1 qmail]#

CPPFLAGS="-I/usr/include/mysql" LDFLAGS="-L/usr/lib/mysql" export CPPFLAGS export LDFLAGS ``env LIBS="-L/usr/lib -lmysqlclient -lz"'' ./configure -- prefix=/var/qmail/courier-imap

and it compilies and checks fine, install fine and works!!!

Mar 17 03:17:50 w1 imapd: LOGIN, user=bs@bs.com, ip=[::ffff:209.179.246.118] Mar 17 03:17:51 w1 imapd: LOGOUT, user=bs@bs.com, ip= [::ffff:209.179.246.118], headers=0, body=0

But, I'm a persistant type, so I then wipe and unpack again and try it this way:

``env LIBS="-L/usr/lib -lmysqlclient -lz"'' ./configure -- prefix=/var/qmail/courier-imap

(no CPPFLAGS or LDFLAGS or export)

And it works fine.

Soooo, the FAQ is wrong (at least on RH7), this is -not- needed:

CPPFLAGS="-I/usr/include/mysql" LDFLAGS="-L/usr/lib/mysql" export CPPFLAGS export LDFLAGS

and the post on the list that says to use:

``env LIBS="-L/usr/local/lib/mysql -lmysqlclient -lz"'' ./configure

should say

``env LIBS="-L<path to the directory where libmysqlclient.so resides> - lmysqlclient -lz"'' ./configure

Thanks again Daniel. Now I can move on to hacking the latest TWIG to get it to work with Courier-Imap/Vpopmail.

-=dwh=-