瀏覽代碼

dovecot sql config

master
父節點
當前提交
32b884e8b9
共有 1 個檔案被更改,包括 7 行新增16 行删除
  1. +7
    -16
      templates/dovecot-sql.conf.ext.j2

+ 7
- 16
templates/dovecot-sql.conf.ext.j2 查看文件

@@ -107,6 +107,7 @@ default_pass_scheme = MD5-CRYPT
#password_query = \
# SELECT username, domain, password \
# FROM users WHERE username = '%n' AND domain = '%d'
password_query = SELECT username AS user,password FROM mailbox WHERE username = '%u' AND active='1'

# userdb query to retrieve the user information. It can return fields:
# uid - System UID (overrides mail_uid setting)
@@ -129,7 +130,12 @@ default_pass_scheme = MD5-CRYPT
# FROM users WHERE username = '%n' AND domain = '%d'
#
# postfixadmin: Query to retrieve user information, note uid matches dovecot.conf AND Postfix virtual_uid_maps parameter.
user_query = SELECT maildir, 1001 AS uid, 1001 AS gid FROM mailbox WHERE username = '%u' AND active='1'
user_query = SELECT CONCAT('*:bytes=', \
IF(mailbox.quota = 0, domain.maxquota*1024000, mailbox.quota)) \
as quota_rule \
FROM mailbox, domain \
WHERE username = '%u' AND mailbox.active = '1' AND \
domain.domain = '%d' AND domain.active = '1'

# 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
@@ -139,21 +145,6 @@ user_query = SELECT maildir, 1001 AS uid, 1001 AS gid FROM mailbox WHERE usernam
# SELECT userid AS user, password, \
# home AS userdb_home, uid AS userdb_uid, gid AS userdb_gid \
# FROM users WHERE userid = '%u'
#
# postfixadmin: Query to retrieve password. user can be used to retrieve username in other
# formats also.
password_query = SELECT username AS user,password FROM mailbox WHERE username = '%u' AND active='1'

# Query to get a list of all usernames.
#iterate_query = SELECT username AS user FROM users






# MYSQL :
user_query = SELECT CONCAT('/var/vmail/mail/', maildir) AS home, 1001 AS uid, 1001 AS gid,
CONCAT('*:bytes=', quota) AS quota_rule FROM mailbox WHERE username = '%u' AND active='1'
# PostgreSQL : (no Quota though) :
# user_query = SELECT '/var/vmail/mail/' || maildir AS home, 1001 as uid, 1001 as gid FROM mailbox WHERE username = '%u' AND active = '1'

Loading…
取消
儲存