start dovecot config; generate postfix transport_map; support multiple sender IPs...
[ansible.git] / roles / email / templates / master.cf
index e6eeb149766489f2c7b4e4604c54d81bb3ef78b7..f0537462c3bd7439e49a615dfbd1c58350744aed 100644 (file)
@@ -41,7 +41,20 @@ verify    unix  -       -       y       -       1       verify
 flush     unix  n       -       y       1000?   0       flush
 proxymap  unix  -       -       n       -       -       proxymap
 proxywrite unix -       -       n       -       1       proxymap
+{% if postfix.smtp_outgoing is defined %}
+{% for item in postfix.smtp_outgoing %}
+{{item.name}} unix  -       -       -       -       -       smtp
+  -o smtp_helo_name={{item.hostname}}
+  -o smtp_bind_address={{item.ip}}
+{% if item.ip_v6 is defined %}
+  -o smtp_bind_address6={{item.ip_v6}}
+{% else %}
+  -o inet_protocols=ipv4
+{% endif %}
+{% endfor %}
+{% else %}
 smtp      unix  -       -       y       -       -       smtp
+{% endif %}
 relay     unix  -       -       y       -       -       smtp
 #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
 showq     unix  n       -       y       -       -       showq