Commit 496917d4 authored by Hinrikus Wolf's avatar Hinrikus Wolf

Merge branch 'issue-8' into 'master'

add smarthost and transport_map capabilities

See merge request !6
parents 349d30ba 6bbd1835
......@@ -33,3 +33,11 @@ postfix_aliases_rt: []
# - queue: IT
# url: https://rt.example.com
# address: it
postfix_relay_host: ""
postfix_transport_maps: []
# - domain: foo.example.com
# server: mail.bar.example.com
# port: 2025
# protocol: smtp
# use_mx: true
......@@ -11,3 +11,6 @@
- name: postmap virtual
command: postmap cdb:/etc/postfix/virtual
- name: postmap transport
command: postmap cdb:/etc/postfix/transport
......@@ -116,3 +116,14 @@
tags:
- postfix
- mail
- name: ensure transport_maps are configured
template:
src: transport.j2
dest: /etc/postfix/transport
notify:
- postmap transport
when: postfix_transport_maps|bool
tags:
- postfix
- mail
......@@ -6,7 +6,10 @@ myhostname = {{ ansible_fqdn }}
myorigin = /etc/mailname
mydestination = $myhostname localhost {{ postfix_domains | join(" ") }}
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
relayhost =
relayhost = {{ postfix_relay_host }}
{% if postfix_transport_maps|bool %}
transport_maps = cdb:/etc/postfix/transport
{% endif %}
{% if postfix_domains|count > 0 %}
{% if postfix_prefer_lmtp %}
mailbox_transport = lmtp:unix:private/dovecot-lmtp
......
{% for transport in postfix_transport_maps %}
{% if transport.use_mx|default(true) %}
{{ transport.domain }} {{ transport.protocol|default("") }}:{{ transport.server }}{{ ":"~transport.port if transport.port|default(false)|bool else "" }}
{% else %}
{{ transport.domain }} {{ transport.protocol|default("") }}:[{{ transport.server }}]{{ ":"~transport.port if transport.port|default(false)|bool else "" }}
{% endif %}
{% endfor %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment