diff --git a/defaults/main.yml b/defaults/main.yml index 3bb1724..18205b4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,10 +1,10 @@ mailname: "{{inventory_hostname}}" -postfix_method: postfixadmin postfix_smtp_service: true -postfix_submission_service: true +postfix_submission_service: false +postfix_with_postfixadmin: false postfix_postfixadmin_mysql_host: localhost postfix_postfixadmin_mysql_database: postfixadmin postfix_postfixadmin_mysql_username: postfix @@ -15,9 +15,10 @@ postfix_check_spamhaus: false postfix_with_opendkim: false postfix_with_opendmarc: false -postfix_virtual_transport: lmtp:unix:private/dovecot-lmtp +postfix_virtual_transport: postfix_submission_service_smtpd_sasl_path: private/auth +postfix_with_dovecot_lmtp: false postfix_smtps_service: true diff --git a/tasks/main.yml b/tasks/main.yml index e3ce639..18af2f6 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -63,7 +63,7 @@ when: postfix_with_opendmarc - import_tasks: postfixadmin.yml - when: postfix_method == "postfixadmin" + when: postfix_with_postfixadmin - name: check postfix configuration command: postfix check diff --git a/templates/main.cf.j2 b/templates/main.cf.j2 index a4b454b..e72b44a 100644 --- a/templates/main.cf.j2 +++ b/templates/main.cf.j2 @@ -46,7 +46,9 @@ smtp_tls_security_level = may ### transport configuration relay_domains = hash:/etc/postfix/transport_maps -transport_maps = hash:/etc/postfix/transport_maps +transport_maps = + hash:/etc/postfix/transport_maps, + ### rules and restricitons @@ -128,23 +130,41 @@ virtual_alias_domains = virtual_alias_maps = hash:/etc/postfix/virtual_alias_maps, -{% if postfix_method == "postfixadmin" %} +{% if postfix_with_postfixadmin %} proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_maps.cf, proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_maps.cf, - proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_catchall_maps.cf + proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_catchall_maps.cf, +{% endif %} +{% if postfix_with_sympa %} + hash:/etc/postfix/virtual.sympa, {% endif %} virtual_mailbox_domains = hash:/etc/postfix/virtual_mailbox_domains, -{% if postfix_method == "postfixadmin" %} - proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_domains_maps.cf +{% if postfix_with_postfixadmin %} + proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_domains_maps.cf, +{% endif %} +{% if postfix_with_sympa %} + hash:/etc/postfix/domains.sympa, {% endif %} virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox_maps, -{% if postfix_method == "postfixadmin" %} +{% if postfix_with_postfixadmin %} proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_mailbox_maps.cf, - proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_mailbox_maps.cf + proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_mailbox_maps.cf, +{% endif %} +{% if postfix_with_sympa %} + hash:/etc/postfix/transport.sympa, + hash:/var/lib/sympa/transport, + hash:/etc/postfix/virtual.sympa, {% endif %} -virtual_transport = {{postfix_virtual_transport}} +virtual_transport = +{% if postfix_with_sympa %} + hash:/etc/postfix/transport.sympa, + hash:/var/lib/sympa/transport, +{% endif %} +{% if postfix_with_dovecot_lmtp %} + lmtp:unix:private/dovecot-lmtp, +{% endif %} diff --git a/templates/master.cf.j2 b/templates/master.cf.j2 index c6cb446..937f07b 100644 --- a/templates/master.cf.j2 +++ b/templates/master.cf.j2 @@ -135,6 +135,12 @@ scalemail-backend unix - n n - 2 pipe mailman unix - n n - - pipe flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user} +{% if postfix_with_sympa %} +sympa unix - n n - - pipe + flags=hqRu user=sympa argv=/usr/local/sympa/bin/queue ${nexthop} +sympabounce unix - n n - - pipe + flags=hqRu user=sympa argv=/usr/local/sympa/bin/bouncequeue ${nexthop} +{% endif %} {% if postfix_check_spf %} # spf