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:mouss (mou@netoyen.net)
Date:May 28, 2006 2:01:34 pm
List:net.sourceforge.lists.courier-users

ma@intron.ac wrote:

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'".

This actually works. This is a valid mysql statement. SELECT 'foo'; returns 'foo'.

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

He doesn't need to add unnecessary columns.

Actually, only a field "home" is enough, which implies every user's maildir as "$HOME/Maildir". No need to specify "maildir" respectively.

no, his home is constant. he thus needs to define a maildir field, either in his sql table or use something like

MYSQL_MAILDIR_FIELD concat(domain, '/', username, '/') (I'm not sure what's in his 'username' field though...).

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".

127.0.0.1 may help in chrotted environments. also, some systems have a broken implementation of unix sockets.