7 messages in net.sourceforge.lists.courier-sqwebmailRe: [sqwebmail] unable to login using...
FromSent OnAttachments
Julian GrunnellJul 25, 2007 3:11 am 
Brian CandlerJul 25, 2007 12:40 pm 
Julian GrunnellJul 26, 2007 7:01 am 
Brian CandlerJul 26, 2007 7:28 am 
Brian CandlerJul 26, 2007 7:39 am 
Julian GrunnellJul 27, 2007 1:05 am 
Brian CandlerJul 27, 2007 4:32 am 
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: [sqwebmail] unable to login using mysql authenticationActions...
From:Brian Candler (B.Ca@pobox.com)
Date:Jul 25, 2007 12:40:45 pm
List:net.sourceforge.lists.courier-sqwebmail

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.