From 92cef3dd298fb496e62f143776bd9893745ebfeb Mon Sep 17 00:00:00 2001
From: Lars Beckers <lars.beckers@rwth-aachen.de>
Date: Mon, 26 Apr 2021 00:14:20 +0200
Subject: [PATCH] postfix: add some hardcoded, but gated fsmpi-specific options

---
 postfix/templates/main.cf.j2 | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/postfix/templates/main.cf.j2 b/postfix/templates/main.cf.j2
index 34c2d46..6acc3c9 100644
--- a/postfix/templates/main.cf.j2
+++ b/postfix/templates/main.cf.j2
@@ -11,6 +11,8 @@ relay_domains = {{ postfix_relay_domains|join(" ") }}
 relayhost = {{ postfix_relay_host }}
 {% if postfix_transport_maps|count > 0 %}
 transport_maps = cdb:/etc/postfix/transport
+{% elif postfix_fsmpi|default(false) and ansible_hostname == "mail" %}
+transport_maps = pgsql:/etc/postfix/pgsql-transport.cf
 {% endif %}
 {% if postfix_luser_relay != "" %}
 luser_relay = {{ postfix_luser_relay }}
@@ -118,6 +120,18 @@ virtual_gid_maps = static:5000
 {% set _x = postfix_notify_classes.extend(["resource", "software"]) %}
 notify_classes = {{ postfix_notify_classes|unique|join(", ") }}
 
+{% if postfix_fsmpi|default(false) and ansible_hostname == "lists" %}
+mailman_destination_recipient_limit = 1
+{% elif postfix_fsmpi|default(false) and ansible_hostname == "mail" %}
+local_header_rewrite_clients = permit_mynetworks
+2525_smtpd_recipient_restrictions = check_sender_access
+	pcre:/etc/postfix/nullmailer_class.pcre
+smtpd_restriction_classes = nullmailer
+nullmailer =
+	check_recipient_access cdb:/etc/postfix/known_mailaddresses
+	check_recipient_access pcre:/etc/postfix/nullmailer_recipient_filters.pcre
+{% endif %}
+
 {% if postfix_enable_postscreen and not postfix_satellite_only %}
 postscreen_access_list = permit_mynetworks
                          cidr:/etc/postfix/postscreen_access.cidr
-- 
GitLab