# Courier IMAP hanging on login

## TinheadNed

I've done something to my server and the end result is that successful logins to courier-imap (4.8.0) in either plain or SSL hang.  Failed logins work fine, but once authlib says the login is successul, courier won't send any further data until the client drops the connection (in squirrelmail, telnet, or kontact)

```
Aug 15 23:12:19 localhost imapd: LOGIN: ip=[::ffff:188.220.140.25], command=LOGIN

Aug 15 23:12:19 localhost imapd: LOGIN: ip=[::ffff:188.220.140.25], username=d

Aug 15 23:12:19 localhost imapd: LOGIN FAILED, user=d, ip=[::ffff:188.220.140.25]

Aug 15 23:12:34 localhost imapd: LOGIN: ip=[::ffff:188.220.140.25], command=LOGIN

Aug 15 23:12:34 localhost imapd: LOGIN: ip=[::ffff:188.220.140.25], username=widget
```

It's pretty slow to reject the bad user (couple of seconds), but the successful login can wait forever.  Any ideas on how even to get better logging info?  The documentation is sparse.

The setup is pretty simple, just authenticating Unix users, no LDAP, SQL.  I think a recent update must have broken it somehow - maybe perl?

```
     Sun Aug 12 16:32:33 2012 >>> sys-libs/e2fsprogs-libs-1.42.5

     Sun Aug 12 16:34:30 2012 >>> net-misc/wget-1.14

     Sun Aug 12 16:35:50 2012 >>> sys-fs/e2fsprogs-1.42.5

     Sun Aug 12 16:43:48 2012 >>> media-sound/alsa-headers-1.0.25

     Sun Aug 12 16:44:57 2012 >>> media-libs/alsa-lib-1.0.25-r1

     Sun Aug 12 16:46:15 2012 >>> net-wireless/bluez-4.101-r2

     Sun Aug 12 16:49:31 2012 >>> x11-drivers/nvidia-drivers-302.17-r1

     Sun Aug 12 16:53:42 2012 >>> media-libs/libpng-1.5.12

     Sun Aug 12 16:54:03 2012 >>> media-libs/libpng-1.2.50

     Sun Aug 12 16:54:14 2012 >>> app-admin/logrotate-3.8.2

     Sun Aug 12 17:02:02 2012 >>> dev-lang/perl-5.16.1

     Sun Aug 12 17:02:33 2012 >>> sys-kernel/linux-headers-3.5

     Sun Aug 12 17:02:46 2012 >>> app-portage/ufed-0.40.1-r1

     Sun Aug 12 17:03:30 2012 >>> net-firewall/iptables-1.4.15

     Sun Aug 12 17:11:43 2012 >>> net-fs/samba-3.6.7

     Sun Aug 12 17:14:35 2012 >>> sys-kernel/gentoo-sources-3.5.1

     Sun Aug 12 17:16:46 2012 >>> net-dns/bind-tools-9.9.1_p2-r1

     Sun Aug 12 17:20:49 2012 >>> net-dns/bind-9.9.1_p2-r1

     Sun Aug 12 17:26:04 2012 >>> dev-libs/glib-2.32.4

     Sun Aug 12 17:26:17 2012 >>> x11-proto/inputproto-2.2

     Sun Aug 12 17:26:56 2012 >>> media-sound/alsa-utils-1.0.25-r3

     Sun Aug 12 17:29:05 2012 >>> net-libs/libtorrent-0.13.2

     Sun Aug 12 17:29:31 2012 >>> x11-libs/libpciaccess-0.13.1

     Sun Aug 12 17:31:39 2012 >>> sys-apps/iproute2-3.5.0

     Sun Aug 12 17:31:56 2012 >>> x11-apps/setxkbmap-1.3.0

     Sun Aug 12 17:34:09 2012 >>> app-admin/syslog-ng-3.3.5-r1

     Sun Aug 12 17:35:16 2012 >>> net-fs/nfs-utils-1.2.6

     Sun Aug 12 17:35:38 2012 >>> x11-misc/xkeyboard-config-2.6

     Sun Aug 12 17:38:17 2012 >>> net-p2p/rtorrent-0.9.2

     Sun Aug 12 17:38:34 2012 >>> sys-apps/portage-2.1.11.10

     Sun Aug 12 17:44:14 2012 >>> sys-boot/grub-2.00

     Sun Aug 12 17:45:06 2012 >>> sys-block/thin-provisioning-tools-0.1.5-r1

     Sun Aug 12 17:45:25 2012 >>> app-portage/gentoolkit-0.3.0.6-r3
```

----------

## audiodef

I have a link in my sig to setting up an email server (postfix/cyrus). Maybe something in there can help you.

As far as updates breaking things, this should help you track future bjorks down:

1. Create a dir for storing Portage logs (~/Portage)

2. Create subdirs Logs and Depclean

3. cd ~/Portage/Logs

4. emerge --sync (layman -S, etc.)

5. emerge -pvuDN world > (year)_(month)_(day)

6. Remove -p and run update

7. cd ../Depclean

8. emerge --depclean > (year)_(month)_(day)

If anything doesn't work right after your update, check the last log for possible culprits and roll them back for testing. You can then either look for fixes or mask versions that break stuff for you.

Been doing things this way for a while now and I've stopped having the "what the hell broke" conundrum.

----------

## khayyam

 *TinheadNed wrote:*   

> 
> 
> ```
>     Sun Aug 12 17:02:33 2012 >>> sys-kernel/linux-headers-3.5
> ```
> ...

 

TinheadNed ... it really not a good idea to update linux-headers, and I'm fairly sure this shouldn't happen, unless perhaps its in @world. I can't say this is the cause of your problem but if I were to go just on the list of packages updated then this would be my first choice of possible offenders.

best ... khay

----------

## TinheadNed

Thanks for the suggestions guys.  I'll take linux-headers out of world, although I've not had problems with them previously, and it wouldn't be the cause this time unless something compiled after that, that courier depended on.

I've been mainly struggling with courier's logging and documentation, so I've decided to replace with dovecot, which I installed at work a while back and was surprised by the ease-of-use.  It's in now, and the only problem so far is that move-to-trash isn't working.  I'll have a ponder on that one and whether it's a deal breaker, but if nothing else I have mail while I try to fix it.

I'm not going to mark this as fixed, as I have no idea what's wrong with courier still.

----------

