diff --git a/defaults/main.yml b/defaults/main.yml index 07fd9a5..f90c0cc 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -12,3 +12,8 @@ postfix_pflogsum_mail_subject: "Mailserver Statistics" tls_helper_domains_file: tls_domains tls_helper_postfix_dir: /var/lib/postfix/tls-helper + +postfix_virtual_domains_file: virtual_domains +postfix_virtual_aliases_file: virtual_aliases + +postfix diff --git a/files/postfix/conf.d/bogus_mx b/files/postfix/conf.d/bogus_mx deleted file mode 100644 index ecf7913..0000000 --- a/files/postfix/conf.d/bogus_mx +++ /dev/null @@ -1,10 +0,0 @@ -# Managed by Ansible - -# bogus networks -0.0.0.0/8 550 Mail server in broadcast network -1.0.0.0/8 550 Mail server in IANA reserved network -#10.0.0.0/8 550 No route to your RFC 1918 network -127.0.0.0/8 550 Mail server in loopback network -224.0.0.0/4 550 Mail server in class D multicast network -#172.16.0.0/12 550 No route to your RFC 1918 network -192.168.0.0/16 550 No route to your RFC 1918 network diff --git a/tasks/postfix.yml b/tasks/postfix.yml index a707bd7..0aad824 100644 --- a/tasks/postfix.yml +++ b/tasks/postfix.yml @@ -25,7 +25,6 @@ dest: "{{ postfix_conf_dir }}/{{ item }}" mode: "0644" loop: - - bogus_mx - header_checks - header_checks_inbound @@ -36,6 +35,7 @@ mode: "0644" loop: - bad_smtp_auth_users + - bogus_mx - client_checks - destination_limit - header_add diff --git a/templates/postfix/conf.d/bogus_mx.j2 b/templates/postfix/conf.d/bogus_mx.j2 new file mode 100644 index 0000000..112434b --- /dev/null +++ b/templates/postfix/conf.d/bogus_mx.j2 @@ -0,0 +1,7 @@ +### {{ managed_by_ansible }} + +{% if postfix_bogus_mx is defined %} +{% for mx in postfix_bogus_mx %} +{{ "%-30s %s" | format(mx.src, mx.msg) }} +{% endfor %} +{% endif %}