From ac2deb37e4e91bf60d5ffeb9387035a4e9c96144 Mon Sep 17 00:00:00 2001 From: Morre Date: Sun, 12 Jul 2020 13:58:00 +0200 Subject: [PATCH] Cleanup of dovecot vs. LDAP settings --- templates/main.cf.j2 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/templates/main.cf.j2 b/templates/main.cf.j2 index bff0fae..b45178c 100644 --- a/templates/main.cf.j2 +++ b/templates/main.cf.j2 @@ -83,14 +83,24 @@ smtpd_recipient_restrictions = permit_mynetworks, {% if ("virtual_transport" in postfix and postfix.virtual_transport == "dovecot") or postfix.ldap.enable %} +{# This applies when LDAP or dovecot are configured #} smtpd_sasl_auth_enable = yes {% endif %} -{% if "virtual_transport" in postfix and postfix.virtual_transport == "dovecot" %} +{% if ("virtual_transport" in postfix and postfix.virtual_transport == "dovecot") + and postfix.ldap.enable +%} +{# This applies when dovecot and LDAP are configured #} +dovecot_destination_recipient_limit = 1 +virtual_transport = dovecot +{% endif %} + +{% if ("virtual_transport" in postfix and postfix.virtual_transport == "dovecot") + and not postfix.ldap.enable +%} +{# This applies when dovecot is configured, but not LDAP #} smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth -smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination - dovecot_destination_recipient_limit = 1 virtual_transport = dovecot {% endif %}