It seemed I had to add something like that in dovecot-sql.conf iterate_query = select MBOX_NAME AS username from M_MAILBOX WHERE MBOX_NAME = '%n';
so I did but I'm still getting no usernames
so I enabled general_log in mysql
that what I get: select MBOX_NAME AS username from M_MAILBOX WHERE MBOX_NAME = ''
It seems like direcotor don't expand variables, I've tried both - %n and %u - nothing any help ?
-----Original Message----- From: dovecot-bounces@dovecot.org [mailto:dovecot-bounces@dovecot.org] On Behalf Of Костырев Александр Алексеевич Sent: Sunday, June 10, 2012 9:49 PM To: dovecot@dovecot.org Subject: [Dovecot] director userdb problem
hello !
I'm trying to get users from dovecot director server:
doveadm director map
doveadm(root): Error: User listing returned failure
doveadm(root): Error: user listing failed
user mail server ip expire time
<unknown> 192.168.5.101 2012-06-10 21:54:06
in logs I get: Jun 10 21:41:14 mail-lvsm dovecot: auth-worker(17510): mysql(172.5.14.1): Connected to database EXIM Jun 10 21:41:14 mail-lvsm dovecot: auth-worker(17510): Warning: mysql: Query failed, retrying: Table 'EXIM.users' doesn't exist Jun 10 21:41:14 mail-lvsm dovecot: auth-worker(17510): Error: sql: Iterate query failed: Table 'EXIM.users' doesn't exist (using built-in default iterate_query: SELECT username, domain FROM users)
in my dovecot.conf I have: userdb { driver = sql args = /etc/dovecot/dovecot-sql.conf } passdb { driver = static args = proxy=y nopassword=y } and in /etc/dovecot/dovecot-sql.conf: user_query = select MBOX_NAME AS user from M_MAILBOX WHERE (MBOX_NAME = '%u');
Do I have to use special table named users ? is it hard-coded?