diff --git a/templates/main.cf.j2 b/templates/main.cf.j2 index 3b3b049..9ad35de 100644 --- a/templates/main.cf.j2 +++ b/templates/main.cf.j2 @@ -80,29 +80,29 @@ smtpd_recipient_restrictions = permit_mynetworks, reject_non_fqdn_recipient, permit -{% if ("virtual_transport" in postfix and postfix.virtual_transport == "dovecot") +{% if ("mailbox_transport" in postfix and postfix.mailbox_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 ("mailbox_transport" in postfix and postfix.mailbox_transport == "dovecot") and postfix.ldap.enable %} {# This applies when dovecot and LDAP are configured #} dovecot_destination_recipient_limit = 1 -virtual_transport = dovecot +mailbox_transport = dovecot {% endif %} -{% if ("virtual_transport" in postfix and postfix.virtual_transport == "dovecot") +{% if ("mailbox_transport" in postfix and postfix.mailbox_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 dovecot_destination_recipient_limit = 1 -virtual_transport = dovecot +mailbox_transport = dovecot {% endif %} # Virtual maps