On Wed, Jul 25, 2007 at 11:12:21AM +0100, Julian Grunnell wrote:
So my
understanding is that the "/usr/local/etc/authlib/authmysqlrc" file
needs to have a specific "MYSQL_SELECT_CLAUSE" defined, but it is this
that I cannot seem to get right.
No, you don't need to set MYSQL_SELECT_CLAUSE for a simple table like yours.
However, if you do decide to use MYSQL_SELECT_CLAUSE, then your query must
return exactly 10 columns, as documented in authmysqlrc. These are
username, cryptpw, clearpw, uid, gid, home, maildir, quota, fullname, options
And if you look at the example, you can see that you can use '' to return an
empty string for values which you don't have.
However, it will probably be easier in your case just to leave
MYSQL_SELECT_CLAUSE unset, and instead use the individual column settings:
MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD '1234' # change this to your chosen mail uid
MYSQL_GID_FIELD '1234'
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD home
Then authmysql will build the appropriate SQL query itself.
When that's working you might also want to play with MYSQL_WHERE_CLAUSE,
e.g. to only allow access for accounts where suspended='N'
HTH,
Brian.