aboutsummaryrefslogtreecommitdiffstats
path: root/roles/mail/templates/dovecot/passwd.j2
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-03-07 18:15:08 +0800
committerAaron LI <aly@aaronly.me>2018-03-14 11:35:08 +0800
commit1988a3dea8297735e8a333548815f28bff509107 (patch)
tree1fcaf0b2ca73d7caa0bac54e493ee4b66e9402c6 /roles/mail/templates/dovecot/passwd.j2
parent6a7dba0f8d6790a0ad51656cc1a6d5f992c8d79b (diff)
downloadansible-dfly-vps-1988a3dea8297735e8a333548815f28bff509107.tar.bz2
mail/dovecot: use both passdb and userdb files to support user aliases
Diffstat (limited to 'roles/mail/templates/dovecot/passwd.j2')
-rw-r--r--roles/mail/templates/dovecot/passwd.j231
1 files changed, 0 insertions, 31 deletions
diff --git a/roles/mail/templates/dovecot/passwd.j2 b/roles/mail/templates/dovecot/passwd.j2
deleted file mode 100644
index e2552f2..0000000
--- a/roles/mail/templates/dovecot/passwd.j2
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# /usr/local/etc/dovecot/passwd
-# Dovecot authentication database in passwd-file format.
-#
-# Format:
-# user:password:uid:gid:(gecos):home:(shell):extra_fields
-#
-# Aaron LI
-#
-
-{% set mydomain = mail.domains[0] %}
-{% for domain in mail.domains %}
-# [domain: {{ domain }}]
-{% for user in mail.userdb %}
-{% set name = user.name %}
-# (user: {{ name }})
-{{ name }}@{{ domain }}:{{ passdb[name].pass }}::::::user={{ name }}@{{ mydomain }}
-{% for dev in user.devices|default([]) %}
-{{ name }}@{{ domain }}@{{ dev }}:{{ passdb[name].devices[dev] }}::::::user={{ name }}@{{ mydomain }}
-{% endfor %}{# devices #}
-{% if user.name != "root" and user.aliases is defined %}
-# aliases
-{% for alias in user.aliases|default([]) %}
-{{ alias }}@{{ domain }}:{{ passdb[name].pass }}::::::user={{ name }}@{{ mydomain }}
-{% for dev in user.devices|default([]) %}
-{{ alias }}@{{ domain }}@{{ dev }}:{{ passdb[name].devices[dev] }}::::::user={{ name }}@{{ mydomain }}
-{% endfor %}{# devices #}
-{% endfor %}{# alias #}
-{% endif %}{# aliases #}
-{% endfor %}{# user #}
-{% endfor %}{# domain #}