<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.4630.0">
<TITLE>auth_passdb using MySQL fails at starup</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Courier New">I've got dovecot v0.99.14, MySql 4.1.11 and postfix on fedora core 4&#8230;</FONT>

<BR><FONT SIZE=2 FACE="Courier New">when using uxix socket I get: </FONT>

<BR><FONT SIZE=2 FACE="Courier New">dovecot-auth: MySQL: Can't connect to database vmail: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)</FONT></P>

<P><FONT SIZE=2 FACE="Courier New">when using tcp socket I get: </FONT>

<BR><FONT SIZE=2 FACE="Courier New">dovecot-auth: MySQL: Can't connect to database vmail: Can't create TCP/IP socket (13)</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">* the mysql.sock exists</FONT>

<BR><FONT SIZE=2 FACE="Courier New">* I can connect to mysql -u vmail and select on the table mailbox</FONT>

<BR><FONT SIZE=2 FACE="Courier New">* I can run mysqladmin successfully using the port or the socket</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">As you can see below I modified the password query to be very simple.</FONT>

<BR><FONT SIZE=2 FACE="Courier New">I am surprised to get the error on startup since the password query should not be executed at this point.</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">The problem is not MySql as I am able to query all day long the the vmail database table called mailbox with the vmail user.</FONT></P>

<P><FONT SIZE=2 FACE="Courier New">Not sure what else I can check</FONT>

<BR><FONT SIZE=2 FACE="Courier New">Dovecot error message lacks the reason it can not connect - unless the (13) means anything to anybody???</FONT>

<BR><FONT SIZE=2 FACE="Courier New">Anybody have any ideas???</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">dovecot.conf :</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&#8230;</FONT>

<BR><FONT SIZE=2 FACE="Courier New">auth_assdb = mysql /etc/dovecot-mysql.conf</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">dovecot-mysql.conf : </FONT>

<BR><FONT SIZE=2 FACE="Courier New">db_host = localhost</FONT>

<BR><FONT SIZE=2 FACE="Courier New">db_unix_socket = /var/lib/mysql/mysql.sock</FONT>

<BR><FONT SIZE=2 FACE="Courier New">#db_port = 3306</FONT>

<BR><FONT SIZE=2 FACE="Courier New">db = vmail</FONT>

<BR><FONT SIZE=2 FACE="Courier New">db_user = vmail</FONT>

<BR><FONT SIZE=2 FACE="Courier New">db_passdb = temp</FONT>

<BR><FONT SIZE=2 FACE="Courier New">password_query = SELECT 'test' as password from mailbox</FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Courier New">vmail.sql:</FONT>

<BR><FONT SIZE=2 FACE="Courier New">create database vmail;</FONT>

<BR><FONT SIZE=2 FACE="Courier New">use vmail;</FONT>

<BR><FONT SIZE=2 FACE="Courier New">grant insert,select,update,delete on vmail.* to 'vmail'@'localhost' identified by 'temp';</FONT>

<BR><FONT SIZE=2 FACE="Courier New">CREATE TABLE mailbox (</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Courier New">user&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; varchar(20) not null,</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Courier New">domain&nbsp; varchar(30) not null,</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Courier New">password&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; varchar(20) not null,</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Courier New">status&nbsp; char,</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Courier New">PRIMARY KEY (user,domain)</FONT>

<BR><FONT SIZE=2 FACE="Courier New">);</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">insert into mailbox values('someone',&nbsp;&nbsp; 'domain.org',&nbsp;&nbsp; 'secret',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Y');</FONT>
</P>

</BODY>
</HTML>