Parcourir la source

vmail user and group

master
Parent
révision
125280b041
3 fichiers modifiés avec 19 ajouts et 6 suppressions
  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 Voir le fichier

@@ -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 Voir le fichier

@@ -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 Voir le fichier

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


Chargement…
Annuler
Enregistrer