From 93357144c80641351385f9ba3b289e0b728ac392 Mon Sep 17 00:00:00 2001
From: Hinrikus Wolf <mail@hinrikus-wolf.de>
Date: Wed, 19 Jan 2022 22:24:20 +0100
Subject: [PATCH] postfix: add config option for smtpd_sender_restrictions

---
 postfix/defaults/main.yml    | 3 +++
 postfix/templates/main.cf.j2 | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/postfix/defaults/main.yml b/postfix/defaults/main.yml
index 90d9f63..98ec671 100644
--- a/postfix/defaults/main.yml
+++ b/postfix/defaults/main.yml
@@ -35,6 +35,9 @@ postfix_virtual_alias_maps:
 postfix_sender_login_maps:
   - proxy:pcre:/etc/postfix/login_maps.pcre
 
+postfix_smtpd_sender_restrictions:
+  - reject_sender_login_mismatch
+
 postfix_enable_postscreen: true
 postfix_enable_memcached: false
 postfix_login_suffix: ''
diff --git a/postfix/templates/main.cf.j2 b/postfix/templates/main.cf.j2
index 5d9800c..0df5159 100644
--- a/postfix/templates/main.cf.j2
+++ b/postfix/templates/main.cf.j2
@@ -27,7 +27,7 @@ mailbox_command = {{ postfix_mailbox_command }}
 {% endif %}
 
 smtpd_sender_login_maps = {{ postfix_sender_login_maps|join(" ") }}
-smtpd_sender_restrictions = reject_sender_login_mismatch
+smtpd_sender_restrictions = {{ postfix_smtpd_sender_restrictions|join(" ") }}
 
 smtpd_sasl_type = dovecot
 smtpd_sasl_path = private/auth
-- 
GitLab