I have the same sense. What Simone wrote into authmysqlrc would
take effect in SQL command as:
SELECT '/usr/local/virtual','1001','1001' FROM mailbox WHERE ...
Obviously, your data table hasn't fields "'/usr/local/virtual'"
and "'1001'".
I suggess you to:
1. Add a field "home" into your table "mailbox".
2. Write the three lines as followed:
MYSQL_HOME_FIELD home
MYSQL_UID_FIELD uid
MYSQL_GID_FIELD gid
Actually, only a field "home" is enough, which implies every user's
maildir as "$HOME/Maildir". No need to specify "maildir" respectively.
Besides debugging method introduced by Jay, you may also run MySQL
server in debug mode. In this case, MySQL server will log all submitted
SQL commands in trace file. See the section "Creating Trace Files" (F.1.2
or E.1.2) in MySQL Reference Manual.
P.S. To secure your MySQL server, you may run it with
"--skip-networking" to disable TCP port at all. In authmysqlrc, you may
use "MYSQL_SOCKET" to specify MySQL server's UNIX domain socket entry
instead of "MYSQL_SERVER" for "127.0.0.1".
------------------------------------------------------------------------
From Beijing, China
Jay Lee wrote:
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 [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 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
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users