6 messages in net.sourceforge.lists.courier-usersRe: [courier-users] Authmysql trouble...
FromSent OnAttachments
Simone NanniMay 23, 2006 9:05 am 
Jay LeeMay 23, 2006 10:02 am 
ma...@intron.acMay 23, 2006 10:36 am 
moussMay 28, 2006 2:01 pm 
ma...@intron.acMay 28, 2006 11:11 pm 
moussMay 29, 2006 6:17 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [courier-users] Authmysql trouble...Actions...
From:Jay Lee (jl@pbu.edu)
Date:May 23, 2006 10:02:52 am
List:net.sourceforge.lists.courier-users

Simone Nanni wrote:

Hi everybody, i'm trying to install courier-authlib-0.58 on my SlackWare 10.2 with kernel 2.6.16.16 box that should work with a MySQL 5.0.21 database. I've compiled it in this way:

./configure --prefix=/usr/local/courierauth --with-gnu-ld --without-authuserdb --without-authpam --without-authldap --without-authpwd --without-authshadow --without-authchkpw --without-authpgsql --without-authcustom --without-authpipe --with-authmysql --with-mysql-libs=/usr/local/mysql/lib/mysql --with-mysql-includes=/usr/local/mysql/include/mysql ok

Then i've created a table named "mailbox" in "postfix" database that contains:

mysql> describe mailbox; +----------+--------------+------+-----+---------------------+-------+ | Field | Type | Null | Key | Default | Extra | +----------+--------------+------+-----+---------------------+-------+ | username | varchar(255) | NO | PRI | NULL | | | password | varchar(255) | NO | | NULL | | | name | varchar(255) | NO | | NULL | | | maildir | varchar(255) | NO | | NULL | | | quota | int(10) | NO | | 0 | | | domain | varchar(255) | NO | | NULL | | | created | datetime | NO | | 0000-00-00 00:00:00 | | | modified | datetime | NO | | 0000-00-00 00:00:00 | | | active | tinyint(1) | NO | | 1 | | | uid | varchar(5) | YES | | NULL | | | gid | varchar(5) | YES | | NULL | | +----------+--------------+------+-----+---------------------+-------+ so 'ive configured my authmysqlrc file:

MYSQL_SERVER 127.0.0.1

I vaguely recall this giving me trouble one time, seems mysql doesn't always consider 127.0.0.1 == localhost so users that can only auth to mysql locally would be rejected here. Might try changing it to localhost instead.

MYSQL_PORT 3306 MYSQL_USERNAME postfix MYSQL_PASSWORD postfix MYSQL_OPT 0 MYSQL_DATABASE postfix MYSQL_TABLE mailbox MYSQL_CLEAR_PWFIELD password MYSQL_LOGIN_FIELD username MYSQL_HOME_FIELD '/usr/local/virtual' MYSQL_NAME_FIELD name MYSQL_MAILDIR_FIELD maildir MYSQL_UID_FIELD '1001' MYSQL_GID_FIELD '1001'

This is looking for a field name not a literal value. You should set these to be uid and gid as that is the tables you created above, then put 1001 in the database field.

(i've checked username and password a loooooooooot of times!)

but when i run "authtest" command i always obtain:

Authentication FAILED: Input/output error

Logging the MySQL queries i can see:

060523 18:01:45 11 Connect postfix@localhost <mailto:postfix@localhost> on 11 Init DB postfix and no more............

Why??? Somebody can help me please, i'm becoming crazy!!!! Thanx a lot in advance.

set DEBUG_LOGIN=2 in etc/authlib/authdaemonrc and restart authlib. Then watch your maillog for error messages (note that this will log passwords). If your mysql query is failing this will show why.

Jay