self-hosting/roles/mailserver_dovecot/templates/dovecot-sql.conf.ext.j2

19 lines
534 B
Django/Jinja

# {{ ansible_managed }}
driver = pgsql
connect = \
host=127.0.0.1 \
dbname={{ mailserver_database.db }} \
user={{ mailserver_database.ro_user.name }} \
password={{ mailserver_database.ro_user.pwd }}
user_query = SELECT email as user, \
concat('*:bytes=', quota) AS quota_rule, \
'/var/vmail/%d/%n' AS home, \
5000 AS uid, 5000 AS gid \
FROM virtual_users WHERE email='%u'
password_query = SELECT password FROM virtual_users WHERE email='%u'
iterate_query = SELECT email AS user FROM virtual_users