# courier-imap-ssl and cram-md5 authentication

## vincent-

Hi.

I'm trying to use CRAM-MD5 authentication for courier-imap server, but I can't get it working, and I don't know why.

I have installed this packages:

net-libs/courier-authlib

_ _ Installed versions:  0.62.4!u(01:18:10 04/12/09)(berkdb crypt gdbm pam -debug -ldap -mysql -postgres -vpopmail)

net-mail/courier-imap

_ _ Installed versions:  4.5.0!u(00:39:18 31/08/10)(berkdb gdbm gnutls nls -debug -fam -ipv6 -selinux)

I have this in /etc/courier-imap/imapd file:

```
IMAP_CAPABILITY="IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 IDLE"
```

I have this in /etc/courier/authlib/authdaemonrc file:

```
authmodulelist="authuserdb authpam"
```

I have made a cram-md5 password for my user "peratu" doing this:

```
userdbpw -hmac-md5 | userdb peratu set hmac-md5pw

makeuserdb
```

Now, the content of /etc/courier/authlib/userdb file is:

```
peratu  hmac-md5pw=2f43992e4557848351be96f7ffd1ad12ea0f2edfcff28220e2a0fb573a756271
```

If I check what authentication methods my server supports, kmail says "PLAIN" and "CRAM-MD5". I choose "CRAM-MD5", then I type the password and nothing happens.

The server mail log says this:

```
Aug 31 09:40:50 atom imapd-ssl: A TLS packet with unexpected length was received.

Aug 31 09:40:50 atom imapd-ssl: Connection, ip=[172.16.0.4]

Aug 31 09:40:50 atom imapd-ssl: LOGIN FAILED, method=CRAM-MD5, ip=[172.16.0.4]

Aug 31 09:40:50 atom imapd-ssl: authentication error: Input/output error
```

Anyone can help me?

Thank you in advance.

----------

## gerdesj

Such a beautifully presented request for help needs a response!

Do you have another mail client that you can test with?  So far it is not certain which end is at fault.

Cheers

Jon

----------

## vincent-

I have been busy during last week. I will try with Mozilla Thunderbird tomorrow.

Thanks for your reply.

----------

## vincent-

Ok, I have exactly the same problem using Mozilla Thunderbird.

I can use PLAIN and LOGIN, but CRAM-MD5 doesn't work, I don't know why :S

----------

