Selaa lähdekoodia

vmail user and group

master
vanhempi
commit
125280b041
3 muutettua tiedostoa jossa 19 lisäystä ja 6 poistoa
  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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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


Loading…
Peruuta
Tallenna