[Dovecot] Need help with SQL queries after updating to 1.0a3
Jonathan Vanasco
dovecot-list at 2xlp.com
Mon Oct 10 21:50:51 EEST 2005
I upgraded to 1.0a3 - i have everything in the config migrated over,
but I'm unsure about the way i should be querying postgres
my db handles virtual accounts only, and is set as such:
CREATE TABLE accounts (
local_part VARCHAR(64) NOT NULL,
domain VARCHAR(64) NOT NULL,
password VARCHAR(64) NULL,
home_dir VARCHAR(256) NOT NULL,
uid INTEGER DEFAULT '1003',
gid INTEGER DEFAULT '1003',
active CHAR(1) DEFAULT 'Y'
);
so an entry would be something like:
user | domain.com | md5('passwprd') | /path/to/maildir/ | 1003 | 1003
| Y
I've rewritten the password query as such:
password_query = SELECT local_part || '@' || domain as user,
password FROM accounts WHERE local_part = '%n' AND domain = '%d' AND
active = 'Y' ;
but i can't get things to work with the user query
user_query = SELECT home_dir AS home, uid, gid FROM accounts
WHERE local_part = '%n' AND domain = '%d' ;
can anyone point me in the right direction? the docs in the
distribution aren't very clear, and the wiki seems to have more .9
info than 1.0 info
this is what i've gotten of of auth_debug:
Oct 11 11:53:37 rsrr1 dovecot: auth(default): client in: AUTH
1 PLAIN service=IMAP secured lip=66.250.131.114
rip=209.73.1.130 resp=xxxxxxxxxxxxxx
Oct 11 11:53:37 rsrr1 dovecot: auth(default): sql(test at mydomain.com,
209.73.1.130): query: SELECT local_part || '@' || domain as user,
password FROM accounts WHERE local_part = 'test' AND domain =
'mydomain.com' AND active = 'Y' ;
Oct 11 11:53:37 rsrr1 dovecot: auth(default): client out: OK
1 user=test@ mydomain.com
Oct 11 11:53:37 rsrr1 dovecot: auth(default): master in:
REQUEST 26 93326 1
Oct 11 11:53:37 rsrr1 dovecot: auth(default): passdb(test@
mydomain.com,209.73.1.130): passdb didn't return userdb entries
Oct 11 11:53:37 rsrr1 dovecot: auth(default): userdb(test@
mydomain.com,209.73.1.130): user not found from userdb
Oct 11 11:53:37 rsrr1 dovecot: auth(default): master out:
NOTFOUND 26
Oct 11 11:53:37 rsrr1 dovecot: imap-login: Internal login failure:
user=<test@ mydomain.com>, method=PLAIN, rip=209.73.1.130,
lip=66.250.131.114, TLS
More information about the dovecot
mailing list