浏览代码

vmail user and group

master
父节点
当前提交
125280b041
共有 3 个文件被更改,包括 19 次插入6 次删除
  1. +2
    -0
      defaults/main.yml
  2. +14
    -0
      tasks/main.yml
  3. +3
    -6
      templates/dovecot-sql.conf.ext.j2

+ 2
- 0
defaults/main.yml 查看文件

@@ -2,3 +2,5 @@ dovecot_postfixadmin_mysql_host: localhost
dovecot_postfixadmin_mysql_database: postfixadmin
dovecot_postfixadmin_mysql_username: dovecot
dovecot_postfixadmin_mysql_password: koof5DeNgi5aeR2ewoh9iz1u
vmail_uid: 500
vmail_gid: 500

+ 14
- 0
tasks/main.yml 查看文件

@@ -10,6 +10,20 @@
notify:
- reload dovecot

- name: vmail group
group:
name: vmail
gid: "{{vmail_gid}}"
system: yes

- name: vmail user
user:
name: vmail
uid: "{{vmail_uid}}"
group: vmail
system: yes
home: /var/vmail

- name: dovecot configuration files
template:
src: "{{ item }}.j2"


+ 3
- 6
templates/dovecot-sql.conf.ext.j2 查看文件

@@ -130,12 +130,9 @@ password_query = SELECT username AS user,password FROM mailbox WHERE username =
# 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 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'
user_query = SELECT CONCAT('/var/vmail/', maildir) AS home, \
{{vmail_uid}} AS uid, {{vmail_gid}} AS gid \
FROM mailbox WHERE username = '%u' AND 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


正在加载...
取消
保存