userdb / user map with director

Will Yardley dovecot.org at veggiechinese.net
Mon Aug 10 18:02:58 UTC 2015


This is with dovecot-ee 2.2.18.2 on RHEL6....

To handle backend and frontend on same machine, I'm using the following
hack, as previously outlined here:

[in director instance config]
passdb {
  # See thread ending in:
  # http://dovecot.org/pipermail/dovecot/2012-June/083817.html
  # for why this has to be sql instead of 'static'
  driver = sql
  args = /etc/dovecot/dovecot-sql.conf
}

[in /etc/dovecot/dovecot-sql.conf]
driver = sqlite
connect = /etc/dovecot/empty.db


password_query = select 'y' as proxy, \
NULL as password, \
'y' as nopassword, \
case '%a' \
when '110' then '10110' \
when '995' then '10110' \
when '143' then '10143' \
when '993' then '10143' end \
as port;

This works, but I was getting a failure on usernames, since director
instance didn't have a userdb.

So I tried the following:
[in config]
passdb {
  driver = sql
  args = /etc/dovecot/dovecot-sql.conf
}

userdb {
  driver = prefetch
}
 

and appended the following to the SQL query:
password_query = select '%u' AS user, \

Then I see the following error in the log when I try to run the map
"Trying to iterate users, but userdbs don't support it"

and doveadm -i director director map returns:
Error: User listing returned failure
Error: user listing failed
[...]

I'm sure I'm missing something obvious, so is there an easy fix to make
this mapping work?

w



More information about the dovecot mailing list