From 53c24001bcf553a84bb62e204600abac786c2397 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sat, 4 Jun 2011 14:45:20 +0000 Subject: [PATCH] Updated dovecot configuration. --- etc/alternc/templates/dovecot/dovecot-sql.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/alternc/templates/dovecot/dovecot-sql.conf b/etc/alternc/templates/dovecot/dovecot-sql.conf index f165ddbe..0cbc9b21 100644 --- a/etc/alternc/templates/dovecot/dovecot-sql.conf +++ b/etc/alternc/templates/dovecot/dovecot-sql.conf @@ -117,15 +117,15 @@ default_pass_scheme = MD5 # user_query = SELECT home, 501 AS uid, 501 AS gid FROM users WHERE userid = '%u' # user_query = \ - SELECT path AS home, 33 AS uid, mail_users.uid AS gid \ - FROM mail_users WHERE alias = '%u' + SELECT concat(concat(%%ALTERNC_LOC%%, '/'), mailbox.path) AS home, domaines.compte AS uid, domaines.compte AS gid \ + FROM mailbox JOIN address ON address.id = mailbox.address_id JOIN domaines on domaines.id = address.domain_id WHERE '%u' IN (address.address, replace(address.address, '@', '_')) # If you wish to avoid two SQL lookups (passdb + userdb), you can use # userdb prefetch instead of userdb sql in dovecot.conf. In that case you'll # also have to return userdb fields in password_query prefixed with "userdb_" # string. For example: password_query = \ - SELECT alias AS user, password, \ - path AS userdb_home, 33 AS userdb_uid, uid AS userdb_gid \ - FROM mail_users WHERE alias = '%u' + SELECT '%u' AS user, address.password, \ + concat(concat(%%ALTERNC_LOC%%, '/'), mailbox.path) AS userdb_home, domaines.compte AS userdb_uid, domaines.compte AS userdb_gid \ + FROM mailbox JOIN address ON address.id = mailbox.address_id JOIN domaines on domaines.id = address.domain_id WHERE '%u' IN (address.address, replace(address.address, '@', '_'))