# [SOLVED] Postfix / Courier / Mysql / Vhosting login problems

## John5788

I just recently finished following the setup instructions here: http://en.gentoo-wiki.com/wiki/Virtual_Mail_Server_setup_with_Postfix,_Courier_and_PostfixAdmin

and set up a squirrelmail client on the site to login with.

however, every time I log in, I get this message: ERROR: Connection dropped by IMAP server.

If I look in my mail.log, this is what i see

```
Mar 24 22:37:24 cronus imapd: Connection, ip=[127.0.0.1]

Mar 24 22:37:24 cronus imapd: LOGIN FAILED, user=john5788, ip=[127.0.0.1]

Mar 24 22:37:24 cronus imapd: authentication error: Input/output error
```

I tried to see if it was courier not being able to connect to mysql at all. it looks like at least courier can talk to mysql because when i disable mysql, it trhows a new error:

```
Mar 24 22:42:17 cronus imapd: Connection, ip=[127.0.0.1]

Mar 24 22:42:17 cronus imapd: LOGIN FAILED, user=john5788, ip=[127.0.0.1]

Mar 24 22:42:17 cronus imapd: authentication error: Input/output error

Mar 24 22:42:17 cronus authdaemond: failed to connect to mysql server (server=localhost, userid=postfix): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
```

any idea guys?

----------

## John5788

More information:

i cannot login through telnet either:

```
# telnet localhost 143

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2005 Double Precision, Inc.  See COPYING for distribution information.

a login john5788@x5788.net password

* BYE Temporary problem, please try again later

Connection closed by foreign host.
```

----------

## John5788

more:

turned on debugging in courier and found this in the mail.log:

```
Mar 25 00:01:09 cronus imapd: Connection, ip=[127.0.0.1]

Mar 25 00:01:09 cronus authdaemond: received auth request, service=imap, authtype=login

Mar 25 00:01:09 cronus authdaemond: authmysql: trying this module

Mar 25 00:01:09 cronus authdaemond: authmysqllib: connected. Versions: header 50070, client 50070, server 50070

Mar 25 00:01:09 cronus authdaemond: SQL query: SELECT username, password, clear, '207', '207', '/var/vmail', maildir, "", name, "" FROM mailbox WHERE username = 'john5788' 

Mar 25 00:01:09 cronus authdaemond: mysql_query failed, reconnecting: Unknown column 'clear' in 'field list'

Mar 25 00:01:09 cronus authdaemond: authmysqllib: connected. Versions: header 50070, client 50070, server 50070

Mar 25 00:01:09 cronus authdaemond: mysql_query failed second time, giving up: Unknown column 'clear' in 'field list'

Mar 25 00:01:09 cronus authdaemond: authmysql: TEMPFAIL - no more modules will be tried

Mar 25 00:01:09 cronus imapd: LOGIN FAILED, user=john5788, ip=[127.0.0.1]

Mar 25 00:01:09 cronus imapd: authentication error: Input/output error
```

so it just looks like its failing because of attempting to select the "clear" field of that table, which doesnt exist. now i just gotta find out why its doing this..

----------

## John5788

ok figured it out. comment out MYSQL_CLEAR_PWFIELD in /etc/courier/authlib/authmysqlrc like so

```
##NAME: MYSQL_CLEAR_PWFIELD:0

#

#

#MYSQL_CLEAR_PWFIELD    clear
```

and it works fine.

----------

