On Sábado 25 Diciembre 2010 02:15:02 Sam Varshavchik escribió:
> Thomas Carrié writes:
> > On Viernes 24 Diciembre 2010 23:50:14 Sam Varshavchik escribió:
> >> Thomas Carrié writes:
> >> > Hello,
> >> > 
> >> > My only auth active module is authmysql :
> >> > 
> >> > $ grep ^authmodulelist= /etc/courier/authlib/authdaemonrc
> >> > authmodulelist="authmysql "
> >> > 
> >> > I have 2 users in my DB
> >> > 
> >> > mysql> select * from courier.users;
> >> > +---------+-------+-----+-----+--------------------+-----------------+
> >> > --- ----+
> >> > 
> >> > | id      | clear | uid | gid | home               | options         |
> >> > | crypt |
> >> > 
> >> > +---------+-------+-----+-----+--------------------+-----------------+
> >> > --- ----+
> >> > 
> >> > | tcarrie | some  |   0 |  12 | /var/vmail/tcarrie | disableshared=0 |
> >> > | 
> >> > |    | mamibb  | thing |   0 |  12 | /var/vmail/mamibb  |
> >> > | 
> >> > | disableshared=0 |       |
> >> > 
> >> > +---------+-------+-----+-----+--------------------+-----------------+
> >> > --- ----+
> >> > 
> >> > I can succesfully login into the IMAP server using tcarrie and mamibb
> >> > 
> >> > $ grep mamibb /var/log/messages
> >> > Dec 24 16:05:56 localhost imapd: LOGIN, user=mamibb ....
> >> > 
> >> > But authenumerate returns no rows !
> >> > 
> >> > In what kind of situation authenumerate is supposed to return rows ?
> >> 
> >> In the situation where MYSQL_ENUMERATE_CLAUSE is not set correctly in
> >> authmysqlrc.
> > 
> > I have just set the MYSQL_ENUMERATE_CLAUSE like so :
> > 
> > $ grep ^MYSQL_ENUMERATE_CLAUSE /etc/courier/authlib/authmysqlrc
> > MYSQL_ENUMERATE_CLAUSE  select id,uid,gid,home,concat(home,'.maildir') as
> > maildir,options from users;
> > 
> > I still have no row from authenumerate. At my first try,
> > MYSQL_ENUMERATE_CLAUSE was commented and I had the same result
> > 
> > Now I am adding a new user
> > insert into users (id,home) values ('iii','ooo');
> > 
> > $ authenumerate
> > iii     8       12      ooo     ooo.maildir
> 
> I'm sure that executing "ls -l /ooo.maildir" will tell you that this
> directory does not exist.
> 
> Apart from all your other problems, you also have this one -- the maildir
> field is broken. The maildir field is only required if each account's
> maildir is not $HOME/Maildir, the default configuration.
> 
> Instead of trying to get a customized, non-default, unusual configuration
> working, it should be much easier to set up a standard, default layout for
> mail accounts: just an ordinary home directory, with $HOME/Maildir being
> the account's maildir. In which case the fifth parameter returned by the
> enumeration query can be an empty string.
> 
> > Why is it returning only this user ?
> 
> You are the only one who can answer this question, because you are the only
> one who knows what's in your database, and how your filesystem is laid out.

I am trying to go "standard" :

- At my first post, I was not using MYSQL_ENUMERATE_CLAUSE, you told me the 
problem could come from here, so I have set it this entry, it does not change 
the behaviour of authenumerate

- I think there is no standard Maildir name for Courier-imap : the doc says 
that Maildir is default, but if you let Courier choose the name, it chooses 
.maildir

About  " you are the only one who knows what's in your database "

I have sent the whole content of my DB in the first post (2 rows), in the 
previous post I sent information about new user iii added for my 2nd post. So 
you have information about the DB too.

About " how your filesystem is laid out "
.
Maybe I am wrong but I thought courier-imap is using the filesystem for 
Maildir, and authlib is an underlying layer of courier-imap that is not using 
the Maildir filesystem ? What file could I check to make authenumerate works 
with this authmysql module ?

What is the contract of authenumerate ? The name makes me suppose it should 
list all users ? Each time I run authenumerate I can see in the log the select 
statement generated, there is no where clause, it does returns rows but 
authenumerate does not return any. There is no error in the log.

Currently I have this in my DB :

mysql> SELECT * from users;
+---------+-------+----------+-----+-----+--------------------+----------------------------+-----------------+-------+
| id      | clear | quota    | uid | gid | home               | maildir         
           
| options         | crypt |
+---------+-------+----------+-----+-----+--------------------+----------------------------+-----------------+-------+
| tcarrie | toto  | 10485760 |   0 |  12 | /var/vmail/tcarrie | 
/var/vmail/tcarrie/Maildir | disableshared=0 |       |
+---------+-------+----------+-----+-----+--------------------+----------------------------+-----------------+-------+

See, the log lines show that I have working user that can authenticate even if 
it is not part of authenumerate output

Dec 25 16:43:23 localhost authdaemond: received auth request, service=imap, 
authtype=login
Dec 25 16:43:23 localhost authdaemond: authmysql: trying this module
Dec 25 16:43:23 localhost authdaemond: authmysqllib: connected. Versions: 
header 50151, client 50151, server 50151
Dec 25 16:43:23 localhost authdaemond: SQL query: SELECT id, "", clear, uid, 
gid, home, maildir, quota, "", options FROM users WHERE id = 'tcarrie' 
Dec 25 16:43:23 localhost authdaemond: authmysql: sysusername=<null>, 
sysuserid=0, sysgroupid=12, homedir=/var/vmail/tcarrie, address=tcarrie, 
fullname=<null>, maildir=/var/vmail/tcarrie/Maildir, quota=10485760, 
options=disableshared=0
Dec 25 16:43:23 localhost authdaemond: authmysql: clearpasswd=toto, 
passwd=<null>
Dec 25 16:43:23 localhost authdaemond: Authenticated: sysusername=<null>, 
sysuserid=0, sysgroupid=12, homedir=/var/vmail/tcarrie, address=tcarrie, 
fullname=<null>, maildir=/var/vmail/tcarrie/Maildir, quota=10485760, 
options=disableshared=0
Dec 25 16:43:23 localhost authdaemond: Authenticated: clearpasswd=toto, 
passwd=<null>
Dec 25 16:43:23 localhost imapd: LOGIN, user=tcarrie, ip=[::ffff:127.0.0.1], 
port=[53608], protocol=IMAP
Dec 25 16:43:58 localhost imapd: LOGOUT, user=tcarrie, ip=[::ffff:127.0.0.1], 
headers=0, body=0, rcvd=37, sent=407, time=35

I have setup authuserdb instead of authmysql, I can authenticate with the user 
from the userdb file via courier-imap but still authenumerate returns no row.
Here is the log of a successful login with module authuserdb

Dec 25 17:22:06 localhost authdaemond: received auth request, service=imap, 
authtype=login
Dec 25 17:22:06 localhost authdaemond: authuserdb: trying this module
Dec 25 17:22:06 localhost authdaemond: userdb: opened 
/etc/courier/authlib/userdb.dat
Dec 25 17:22:06 localhost authdaemond: userdb: looking up 'tcarrie'
Dec 25 17:22:06 localhost authdaemond: userdb: home=/var/vmail/tcarrie, uid=0, 
gid=12, shell=<unset>, mail=/var/vmail/tcarrie/Maildir, quota=<unset>, 
gecos=<unset>, options=<unset>
Dec 25 17:22:06 localhost authdaemond: found imappw in userdbshadow
Dec 25 17:22:06 localhost authdaemond: authuserdb: sysusername=<null>, 
sysuserid=0, sysgroupid=12, homedir=/var/vmail/tcarrie, address=tcarrie, 
fullname=<null>, maildir=/var/vmail/tcarrie/Maildir, quota=<null>, 
options=<null>
Dec 25 17:22:06 localhost authdaemond: authuserdb: clearpasswd=<null>, 
passwd=wROXfjM/jalc2
Dec 25 17:22:06 localhost authdaemond: password matches successfully
Dec 25 17:22:06 localhost authdaemond: Authenticated: sysusername=<null>, 
sysuserid=0, sysgroupid=12, homedir=/var/vmail/tcarrie, address=tcarrie, 
fullname=<null>, maildir=/var/vmail/tcarrie/Maildir, quota=<null>, 
options=<null>
Dec 25 17:22:06 localhost authdaemond: Authenticated: clearpasswd=toto, 
passwd=wROXfjM/jalc2
Dec 25 17:22:06 localhost imapd: LOGIN, user=tcarrie, ip=[::ffff:127.0.0.1], 
port=[52285], protocol=IMAP

What else can I try ?

-- 
Thomas Carrié

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

Reply via email to