# courier-authlib problem

## grudge

when running :

```
/usr/lib/courier/courier-authlib/authdaemond
```

I get :

```
INFO: modules="authmysql authpam authuserdb authshadow authcustom authvchkpw", daemons=5

INFO: Installing libauthmysql

INFO: libauthmysql.so: cannot open shared object file: No such file or directory

INFO: Installing libauthpam

INFO: Installation complete: authpam

INFO: Installing libauthuserdb

INFO: Installation complete: authuserdb

INFO: Installing libauthshadow

INFO: Installation complete: authshadow

INFO: Installing libauthcustom

INFO: Installation complete: authcustom

INFO: Installing libauthvchkpw

INFO: /usr/lib/courier-authlib/libauthvchkpw.so.0: undefined symbol: mysql_init

```

courier-imap, vpopmail, mysql and qmail is installed and compiled with the mysql flag, but because of the above error I can't auth against vpopmail. Any ideas ?

----------

## sf_alpha

You probaly not set authdaemonlist in /etc/courier/authlib/authdaemonrc

Set it only you compiled (set in use flag) and you want to use (have authmysqlrc or authpgsqlrc) configation file configured

or it will fail.

Try set

authdaemonrc="authpam authuserdb authshadow authcustom"

----------

## grudge

Nope, all the neccesary options are there. And according to the documentation I should use authmysql if I use vpopmail to authenticate against but only authvchkpw, which means that I don't need to setup authmysqlrc. Did I understand everything ?

Here is my new /etc/courier/authlib/authdaemonrc :

```
authmodulelist="authvchkpw"

authmodulelistorig="authuserdb authpam authshadow authcustom authvchkpw"

daemons=5

authdaemonvar=/var/lib/courier/authdaemon

DEBUG_LOGIN=2

DEFAULTOPTIONS=""

```

and when I do a 

```
/etc/init.d/courier-authlib restart
```

 I get the following error : 

```
Mar 18 07:48:15 mailserver authdaemond: stopping authdaemond children

Mar 18 07:48:16 mailserver authdaemond: modules="authvchkpw", daemons=5

Mar 18 07:48:16 mailserver authdaemond: Installing libauthvchkpw

Mar 18 07:48:16 mailserver authdaemond: /usr/lib/courier-authlib/libauthvchkpw.so.0: undefined symbol: mysql_init

```

----------

## sf_alpha

please show me your use flags

emerge -pv courier-authlib

----------

## grudge

```
These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] net-libs/courier-authlib-0.53  +berkdb +crypt -debug +gdbm -ldap +mysql +pam -postgres (-uclibc) 0 kB

```

Does this help ?

----------

## sf_alpha

If you doesn't need mysql support 

try add 'net-libs/courier-authlib -mysql' to /etc/portage/packages.use

and emerge courier-authlib again

Or add authmysql to authmodulelist

But I think adding authmysql need to setup authmysqlrc for it ?

----------

## gualtrapa

I have the same problem. I have mysql-4.0.24, I downgraded to 0.22. Reemerged vpopmail and courier-imap a lot of time and have allways the same error.

Did anybody repair this error?

----------

## gualtrapa

Repaired, but not solved.

I have another qmail-vpopmail-courier-imap installation, so I copied libauthvchkpw.so.0.0.0 and now it works.

But I'd like to know the problem, because perhaps in the future I must update the programs

----------

## gualtrapa

Now I know what was the problem.

I typed the USE flags at the prompt yesterday. I exited and today I haven't it, and I forgot, so I merged vpopmail without "mysql" USE. In this way I had this at /home/vpopmail/etc/lib_deps:

 *Quote:*   

> -L/var/vpopmail/lib -lvpopmail 

 

I unmerged vpopmail, but when you do it Gentoo doesn't delete data files in /home/vpopmail neither /home/vpopmail/etc.

Now I have  *Quote:*   

> -L/var/vpopmail/lib -lvpopmail -L/usr/lib/mysql  -lmysqlclient -lz -lm -lcrypt in /home/vpopmail/etc/lib_deps

  and all works good

----------

## mbjr

Well guys, I'm havin the same, except I don't have any errors just when I try to login. Check this out:

 *starting authdaemond wrote:*   

> May 16 20:20:40 netsrv authdaemond: modules="authpam authuserdb authshadow authcustom", daemons=5
> 
> May 16 20:20:40 netsrv authdaemond: Installing libauthpam
> 
> May 16 20:20:40 netsrv authdaemond: Installation complete: authpam
> ...

 

starting courier-imapd doesn't say anything, but when I telnet:

 *telnet localhost 143 wrote:*   

> $ telnet localhost 143
> 
> Trying 127.0.0.1...
> 
> Connected to localhost.
> ...

 

 *in the meantime my syslog wrote:*   

> 
> 
> May 16 20:22:17 netsrv imapd: LOGIN: DEBUG: ip=[127.0.0.1], command=LOGIN
> 
> May 16 20:22:17 netsrv imapd: LOGIN: DEBUG: ip=[127.0.0.1], username=myuser
> ...

 

I've checked the courier users forums (found this as some short of useful thing) to figure out what the hack TEMPFAIL is, but it didn't help me much:

 *authdebugging doc wrote:*   

> TEMPFAIL
> 
> The module suffered an internal failure, such as inability to contact an external database. The login is rejected, and no further modules are tried.
> 
> In a typical courier installation, there is only one client module: authdaemon. This formats the authentication request and sends it down a socket to a pool of authdaemond processes (note the extra "d" on the end) which perform the actual work. authdaemond, in turn, contains other authentication modules such as authpam, authmysql, and so on.
> ...

 

This is nice, so for some reason the authdaemond doesn't seem to be running, however it responsd to queries with a TEMPFAIL. 

This is my 5th time sucking with authdaemond and all 4 times before it got solved by just itself, which is a bit strange. I'm really close to get the whole courier package and unmerge it and use something else, cyrus for example  :Smile: 

But first  :Smile:  Do you have any idea what can provide such thing? The auth was working yesterday, the difference was a reboot (since the box were up and running in the last 156 days  :Smile: ))

Thanks,

----------

## mbjr

I know replying to my own post is not the best idea ever  :Smile:  However, I have news, finally got it solved, and again the same problem you had with that, that I'll never figure out what the problem was. My solution after couple of hours of playing with authdaemond was to completely unmerge the courier-authlib and courier-imap, delete all config files and start from scratch.

Emerge completed, imap works fine, but I'm using the same configuration as before  :Wink:  Strange stuff, something got screwed :-/ 

And I just hope it won't happen again...

:-/

HTH,

PS: this was a very microsoft way to fix a problem, so if you have a better solution please let me know  :Smile: 

----------

