[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [HELP] courier-authdaemon frustration



On Tue, 2004-11-23 at 17:27, Bob Billson wrote:
> The customized query maybe the way to go; although it seems to be a bad
> hack to solve the underlaying problem, no? I am missing something?

I used courier-webadmin to set the MySQL authdaemon as the way to go...

Then I have this set of queries:

MYSQL_SELECT_CLAUSE     SELECT CONCAT(localpart, '@', domain), \
                        ENCRYPT(password), \
                        password, \
                        uid, \
                        gid, \
                        '/var/mail/vdomains/$(domain)/$(local_part)', \
                        '', \
                        quota, \
                        fullname, \
                        options \
                        FROM users \
                        WHERE localpart = '$(local_part)' \
                        AND domain = '$(domain)'

MYSQL_ENUMERATE_CLAUSE  SELECT CONCAT(localpart, '@', domain), \
                        uid, \
                        gid, \
                        '/var/mail/vdomains/$(domain)/$(local_part)', \
                        '' \
                        FROM users \
                        WHERE localpart = '$(local_part)' \
                        AND domain = '$(domain)'

MYSQL_CHPASS_CLAUSE     UPDATE users \
                        SET password='$(newpass)' \
                        WHERE localpart='$(local_part)' \
                        AND domain='$(domain)'

Although I don't know of the latter that it really works. You get rid of
all the other fields except of MySQL session information.
You could replace things like ``uid'' and ``gid'' to the integer value
used on your system (I used DEFAULT values in the table instead) like
common in SQL. There's also the possibility to use
CONCAT('/var/mail/vdomains/', domain, '/', localpart)
instead of the hackish way I chose.

Regards,
Philipp Kern

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: