# optional: install and configure mailman
mailman:
default_host: lists.example.org
+ smtp_outgoing: smtp2
default_lang: en # if you change this, also run "dpkg-reconfigure mailman" to enable more languages
domains: # the file /etc/postfix/virtual_alias_map can be used to configure aliases
- lists.example.org
when: virtual_alias_map.changed
command: postmap /etc/postfix/virtual_alias_map
notify: postfix
-- name: create empty sender_transport_map
+- name: create sender_transport_map
when: postfix.smtp_outgoing is defined
register: sender_transport_map
- copy:
+ template:
dest: /etc/postfix/sender_transport_map
- content: ""
- force: no
+ src: templates/sender_transport_map
- name: postmap sender_transport_map
when: sender_transport_map.changed
command: postmap /etc/postfix/sender_transport_map
--- /dev/null
+# default is {{ postfix.default_smtp_outgoing }}
+{% if postfix.mailman is defined and postfix.mailman.smtp_outgoing is defined %}
+{% for item in postfix.mailman.domains %}
+@{{item}} {{ postfix.mailman.smtp_outgoing }}
+{% endfor %}
+{% endif %}