From 1b86e487cc448b6e111f1312d781639b022c3675 Mon Sep 17 00:00:00 2001 From: Julian Rother Date: Tue, 4 Feb 2025 00:39:31 +0100 Subject: [PATCH] Add mailserver.dovecot.config option --- defaults/main.yml | 1 + templates/dovecot/dovecot.conf.j2 | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 9c76227..ff7fe41 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -26,6 +26,7 @@ mailserver: srs_domain: "srs.{{ inventory_hostname }}" dovecot: debug: false + config: {} postfixadmin: php_fpm_config: user: postfixadmin diff --git a/templates/dovecot/dovecot.conf.j2 b/templates/dovecot/dovecot.conf.j2 index 7963d1c..43bc089 100644 --- a/templates/dovecot/dovecot.conf.j2 +++ b/templates/dovecot/dovecot.conf.j2 @@ -158,3 +158,16 @@ auth_verbose = yes auth_debug = yes mail_debug = yes {% endif %} + +{% macro config_items(obj) %} +{% for key, value in obj.items() %} +{% if value is mapping %} +{{ key }} { +{{ config_items(value)|indent(first=true) }} +} +{% else %} +{{ key }} = {{ value }} +{% endif %} +{% endfor %} +{% endmacro %} +{{ config_items(mailserver.dovecot.config) }}