After the first reply I realized I had forgotten to include "home" as part
of the existing pgsql database schema.  It does exist in the mailusers table
as the field 'home' and consists of '/home/mail/<domainname>/<username>',
i.e  '/home/mail/dilligaf.com/ralph'.  See corrected version below.

Preliminary suggestion is to create a view within the database.  This will
likely work, but will effectively double the size of my table.  We have
plenty of server (dual PIII/866 with all the trimmings) but if there's
another way I'd sure like to find it.

-----Original Message-----
From: Bruce Cannon [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 3:34 PM
To: '[EMAIL PROTECTED]'
Subject: authpgsql for multiple domains


New to the list, and spent 5 hours today reading.  Request: please add a
list-specific search engine to the archives.

Current configuration: working qmail Maildir installation with
courier-imap-1.4.3.  Home directories for users under
/home/mail/<domainname>/<username>.  I host multiple domains.

PostgreSQL mailusers table with fields: id (unique per user), uid (same for
everyone), gid (same for everyone), username (i.e. 'ralph'), domainname
(i.e. 'dilligaf.com'), home (i.e. /home/mail/dilligaf.com/ralph), and
password.

I need authpgsql or a suitable module to query the database as it exists
today for the 'username'@'domainname', perhaps:

"SELECT id, password, uid, gid, home, username FROM mailusers WHERE username
= 'ralph' and domainname = 'dilligaf.com';

for authentication.  I could find no obvious way to do this.  The current
query is sent to the sql server as:

"SELECT id, '', password, uid, gid, home, '', '', username FROM mailusers
WHERE id = '[EMAIL PROTECTED]'

This obviously won't work because of the differing databases schema.

I read under ~/authlib/README.authmysql.myownquery and was curious as to how
to apply the patch mentioned there as it may be close to what I'm looking
for.  I obviously need to alter the query that courier-imap is passing to
the pgsql server for authentication.  Changing the database schema is not an
option.

If anyone can point me in the right direction, I'd greatly appreciate the
help.  It has been a frustrating day ;-)

Thanks in advance,

Bruce Cannon
http://www.cimtel.net


_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to