# [courrier-imap] connection failure [solved]

## sylvain.bonnemaison

Hi,

I have installed netqmail and courrier-imap as detailed in the netqmail wiki page.

My php application try to connect to imap but always failed. The log error show following messages :

```
Jul 13 18:28:57 mailer imapd: LOGIN FAILED, user=postmaster@mailer.domain.com, ip=[127.0.0.1]

Jul 13 18:29:02 mailer imapd: LOGIN FAILED, user=postmaster@mailer.domain.com, ip=[127.0.0.1]

Jul 13 18:29:07 mailer imapd: LOGIN FAILED, user=postmaster@mailer.domain.com, ip=[127.0.0.1]

Jul 13 18:29:12 mailer imapd: LOGOUT, ip=[127.0.0.1], rcvd=188, sent=394
```

I'm using the following php command :

```
imap_open("{localhost:143}INBOX", "postmaster@mailer.domain.com", "mypass")
```

What's going wrong with my configuration ?

ThanksLast edited by sylvain.bonnemaison on Thu Jul 15, 2010 8:57 am; edited 2 times in total

----------

## sylvain.bonnemaison

While debuging, i get following messages in log file :

```
Jul 13 23:14:20 mailer authdaemond: stopping authdaemond children

Jul 13 23:14:20 mailer authdaemond: modules="authvchkpw", daemons=5

Jul 13 23:14:20 mailer authdaemond: Installing libauthvchkpw

Jul 13 23:14:20 mailer authdaemond: file not found
```

Should I use authmysql module for authentication ?

----------

## sylvain.bonnemaison

I have switch to authmysql as describe in http://en.gentoo-wiki.com/wiki/Courier-authlib_with_MySQL.

I have this only message from mail.log

```
Jul 15 10:02:10 mailer imapd: Connection, ip=[127.0.0.1]
```

and this message from my php script

```
imap_open("{localhost:143/novalidate-cert}INBOX", "user@mailer.domain.com", "mypass"))

imap_open(): Couldn't open stream

Can not authenticate to IMAP server: [CLOSED] IMAP connection broken (authenticate)
```

What's going wrong ?

----------

## sylvain.bonnemaison

I have fixed some configuration error in authmysqlrc and it works better now.

----------

