# Auth errors after upgrading courier-imap 3.0.8->4.0.1

## Souperman

I've just upgraded courier-imap from 3.0.8 to 4.0.1 and now pam authenticaction no longer works. I figured out that I had to move auth* files from /etc/courier-imap/ to /etc/courier-authlib/, but I still get this in my /var/log/mail.log:

```
Feb  5 12:29:54 wizard authdaemond: modules="authmysql authpam", daemons=5

Feb  5 12:29:54 wizard authdaemond: Installing libauthmysql

Feb  5 12:29:55 wizard authdaemond: Installation complete: authmysql

Feb  5 12:29:55 wizard authdaemond: Installing libauthpam

Feb  5 12:29:55 wizard authdaemond: libauthpam.so: cannot open shared object file: No such file or directory
```

courier-imap doesn't seem to have a USE flag for pam support. How do I get this to work again? For what it's worth, virtual mailbox accounts are still able to auth because the MySQL auth module is working just fine.

----------

## Souperman

OK, got it to work with authshadow. Is this "The Right Way"tm ?

----------

## j-m

 *Souperman wrote:*   

> OK, got it to work with authshadow. Is this "The Right Way"tm ?

 

Looks you have some error in your config files.

 *Quote:*   

> 
> 
> Feb  5 11:53:55 gw authdaemond: modules="authmysql authpam authshadow authcustom", daemons=5
> 
> Feb  5 11:53:55 gw authdaemond: Installing libauthmysql
> ...

 

----------

## ryceck

I solved this problem by removing the entries about authldap and authmysql since I dont use them. 

This at least solved my problem and made authdaemon startable again.

I also removed the /etc/init.d/authdaemond script since there now is a /etc/init.d/courier-authd  :Smile: 

----------

## Souperman

OK, here's my configs for courier-authlib, minus comments and excluding authmysqlrc, since mysql auth isn't a problem.

 */etc/courier/authlib/authdaemonrc wrote:*   

> 
> 
> ```
> 
> authmodulelist="authmysql authshadow"
> ...

 

 */etc/courier/authlib/authdaemond.conf wrote:*   

> 
> 
> ```
> 
> AUTHDAEMOND="authdaemond.mysql"
> ...

 

----------

## nobspangle

After upgrading my courier-imap was suddenly trying to authenticate against mysql.

I changed /etc/courier/authlib/authdaemonrc to have the line

```
authmodulelist="authshadow authpam"
```

now all is well again.

----------

## Souperman

Well for some reason libauthpam.so isn't built when I emerge courier.

----------

## j-m

 *Souperman wrote:*   

> Well for some reason libauthpam.so isn't built when I emerge courier.

 

```
USE="crypt" emerge courier-authlib
```

----------

## Souperman

Added the pam use flag for courier-authlib. Works now.

thanks

----------

## letoff

Thanks to this thread, I've been able to solve the same problem: after an emerge from courier-imap-3.0.8 to 4.0.1 all authentication failed. So I first removed authdaemond from the default level and add courier-authlib instead. But authentication still failed. Then I remove all but authpam and authshadow in authdaemonrc and everything works fine. So thanks to all of you guys.

Nonetheless does any of you know how-to avoid this kind of problem in the future? I mean what documentation do we have to read before emerging such important paquage as emerge -pvl isn't enough?

tia.

----------

## justanothergentoofanatic

Here:

http://www.courier-mta.org/imap/?INSTALL.html~upgrading

I agree that the ebuild should have done this automatically, but it's not the most widely used or best tested ebuild in all of gentoo.

-Mike

----------

## fvant

just gone through the motions   :Sad:   of the upgrade..leaving me with a question:

are pam_mysql and cyrus-sasl still required or has courier-authlib taken over their functionality ?

----------

## justanothergentoofanatic

As far as I know, they were never necessary. Courier has had TLS and MySQL authentication built-in for quite a while.

You can use authmysql instead of pam_mysql and either imapd w/TLS or imapd-ssl w/SSL instead of cyrus-sasl.

-Mike

----------

## Souperman

Although you may still need them if you're using postfix like me.

----------

## fvant

i am in fact using postfix, never mind, i still need them

----------

## jeffrice

One additional point -- it may be necessary to copy authmysqlrc to /etc/courier/authlib.  That got it working for me.

----------

## thoughtform

i'm stuck.

since the upgrade i've been in various config files but squirrelmail is kicking me out with

Error connecting to IMAP server: localhost.

111 : Connection refused

i'm not sure where to start to fix this.

thanks,

Scorpaen

 :Sad: 

i'mtrying to use authpam or authshadow

/etc/courier/autlib/authdaemonrc

snippet -

authmodulelist="authpam authshadow"

----------

## thoughtform

i rebooted and it's working. 

can anyone explain why? i restarted the courier authdaemon.

???

----------

