# Continued courier-imap 4.0.1 upgrade problems [solved]

## gpeangel

Like others, I'm experiencing problems with the upgrade to courier-imap 4.0.1. I've read through the forums regarding this issue and have managed to get the imap server up and running.  However, users still cannot log on to either imap or pop3.  Logs have the following error:

```

Feb  7 10:01:03 carbon imapd: Connection, ip=[::ffff:127.0.0.1]

Feb  7 10:01:18 carbon imapd: LOGIN FAILED, user=user_name@domain.com, ip=[::ffff:127.0.0.1]

Feb  7 10:01:18 carbon imapd: authentication error: Input/output error

```

Previously, authentication was done against MySQL.  Modifying /etc/courier/authlib/authdaemonrc to limit authentication for shadow or pam also fails with the same errror.  I have not been able to find any additional information on just what is causing this error.  Where would there be any I/O? Have I missed a config file change that isn't mentioned in the upgrade notes?  Is anybody else seeing this problem?

----------

## Ateo

First and foremost: Backup /etc/courier-imap in case anything goes awry.

Then -->

1. Move the following:

```
# mv /etc/courier-imap/authdaemonrc /etc/courier

# mv /etc/courier-imap/authmysqlrc /etc/courier
```

2. Stop the current auth daemon (this step stops your currently running imap/pop3 daemons):

```
# /etc/init.d/authdaemond stop
```

3. Delete the old auth daemon:

```
# rm /etc/init.d/authdaemond
```

4. Start the new auth daemon:

```
# /etc/init.d/courier-authlib start
```

5. Start your imap/pop3 daemons:

```
# /etc/init.d/courier-imapd start

# /etc/init.d/courier-imapd-ssl start (if applicable)

# /etc/init.d/courier-pop3d start

# /etc/init.d/courier-pop3d-ssl start (if applicable)
```

All of the threads that exist regarding this upgrade did not work for me. My mail system is the virtual mailsystem found here: Gentoo Virt-Howto. My solution was so simple I could puke. It seems users are missing one crucial point. The files themselves have not changed, only their location has..

Note: I did not edit one single file. I just moved 2.

HTH

----------

## gpeangel

I used the same HOW-TO to set up my mail server, which had been working flawlessly for quite some time.  I did get one insight from your post.  The /etc/courier/authlib/authmysqlrc file probably needs to be set up to function like the old /etc/courier-imap/authmysqlrc file.  Doing this, and restarting courier-authlib, had no effect.  I still get the same error.  I've confirmed by telnet that the imap and pop3 servers are up running.

I've set logging to be as verbose as possible, but I'm still not getting a better idea on what is causing the "Input/output error".

BTW, it looks like restarting courier-authlib automatically restarts the imap and pop3 servers:

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

* Stopping courier-imapd...

* Stopping courier-imapd over SSL...

* Stopping courier-pop3d...

* Stopping courier-pop3d over SSL...

* Stopping courier-authlib: authdaemond...

* Starting courier-authlib: authdaemond...

* Starting courier-imapd...

* Starting courier-imapd over SSL...

* Starting courier-pop3d...

* Starting courier-pop3d over SSL... 
```

----------

## gpeangel

I've restored email capabilites.   Resorted to rebooting the box.

----------

## Ateo

So you got it up and running with courier-imap 4 by rebooting? Or did you revert back to courier-imap 3?

The init script courier-authlib does the same thing authdaemond did. So yea, it restarts your imap/pop3 server *if* they are already up and running....

----------

## gpeangel

 *Ateo wrote:*   

> So you got it up and running with courier-imap 4 by rebooting? Or did you revert back to courier-imap 3?
> 
> 

 

courier-imap 4

Perhaps I had something hung up in memory (ps didn't show anything suspicious) or didn't restart something that needed restarting or...

Makes me nervous.  We'll see what the next few days bring in terms of reliability.

----------

## ww9rivers

It seems that the new courier-authlib ebuild forgot to stop and remove the old "authdaemond".

I hit the same problem using authpam, although I got a slightly different error message: "imapd-ssl: authentication error: No such file or directory". Also, I noticed that I got a failure with "/etc/init.d/courier-authlib stop". After reading this thread I realized that might have something to do with my authentication errors. So I did a "/etc/init.d/courier-authlib zap" and then "/etc/init.d/courier-authlib start". That made things all happy.

----------

## AlbinoJap

I recently updated Courier Imap and found that it was no longer starting.  It was not starting and stopping the authdaemond service properly.  Whenever I would try to stop authdaemond, it would say that  could not kill the correct process.  When I would try to start authdaemond, it would say that it had already been started.  After reading through these threads I figured out that it should not be using the "authdaemond" init script, but it should be using the "courier-authlib" init script.  To use the correct script, you just need to edit the courier-imapd script.  To do this, use the following procedure.

Find this section in the '/etc/init.d/courier-imapd' file.

```
depend() {

        need net authdaemond

        use famd

}
```

Change it to this.

```
depend() {

        need net courier-authlib

        use famd

}
```

After that, all was well.  Hope this helps someone!   :Very Happy: 

----------

## j-m

 *AlbinoJap wrote:*   

> 
> 
> ```
> depend() {
> 
> ...

 

Uhm, this is the default. You could save yourself the troubles if you ran etc-update or dispatch-conf and did not continue to use outdated init scripts from the old version...   :Idea: 

----------

## yottabit

 *Ateo wrote:*   

> 
> 
> 1. Move the following:
> 
> ```
> ...

 

I had to move the files to the authlib subdir:

```
# mv /etc/courier-imap/authdaemonrc /etc/courier/authlib

# mv /etc/courier-imap/authmysqlrc /etc/courier/authlib
```

HTH someone else... Great post! Saved me from being lynched.  :Wink: 

----------

## SilverOne

Great thread!

This gave me the courage to do it, and it worked nearly flawlessly.

Thanx!

----------

## muffy

This saved my backside. Thanks.

----------

## GoofyHMG

Great worked for me also thanks!!!  :Very Happy: 

----------

## d_logan

My files are in the correct authlib directory, but I'm still getting

authentication error: Input/ouput error.

What else could the problem be?

I followed this guide: http://www.gentoo.org/doc/en/virt-mail-howto.xml

----------

## sirber

I have that error on a fresh installation.  :Sad: 

Jun 29 12:35:12 [imapd] LOGIN FAILED, user=sirber, ip=[::ffff:127.0.0.1]

Jun 29 12:35:12 [imapd] authentication error: Input/output error

all files are in the right place.

----------

## funkyshu

ok...i kept running into the same i/o problem...looked at posts all over but finally realized I had missed something small(BIG) in authmysqlrc

the virt-mail-howto says under section 10:

 *Quote:*   

> 
> 
> (Make sure the following line is commented out since we're storing plaintext.)
> 
> #MYSQL_CRYPT_PWFIELD    crypt
> ...

 

so I commented MYSQL_CRYPT_PWFIELD and also, by default, MYSQL_CLEAR_PWFIELD is commented, so I uncommented it and voila!!! it works!!  :Smile: 

I felt like a real 'tard after working on this for several hours.

Lesson:  read the directions very carefully!!

Hope this helps someone else.

----------

