From 21a02baf1e6d005258bedd15e810c606f8615fee Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 14 Nov 2019 19:31:10 +0100 Subject: [PATCH] mail/postfix: fix sort order in smtpd restrictions (#1583) --- mail/postfix/Makefile | 2 +- mail/postfix/pkg-descr | 4 ++++ .../src/opnsense/service/templates/OPNsense/Postfix/main.cf | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index 58f013fc2..2b79564cb 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= postfix -PLUGIN_VERSION= 1.11 +PLUGIN_VERSION= 1.12 PLUGIN_COMMENT= SMTP mail relay PLUGIN_DEPENDS= postfix-sasl PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/mail/postfix/pkg-descr b/mail/postfix/pkg-descr index 2d02a9000..b40207c69 100644 --- a/mail/postfix/pkg-descr +++ b/mail/postfix/pkg-descr @@ -6,6 +6,10 @@ is completely different. Plugin Changelog ================ +1.12 + +* Fix sort order to put sender acces in front of recipient access + 1.11 * Allow suport for v4 or v6 only or both diff --git a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf index a77d035c5..b7cbb9fe1 100644 --- a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf +++ b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf @@ -128,15 +128,15 @@ relay_recipient_maps = hash:/usr/local/etc/postfix/recipient_access {# Sender Restrictions #} {% set smtpd_recipient_restrictions=[] %} +{% if helpers.exists('OPNsense.postfix.sender.senders.sender') %} +{% do smtpd_recipient_restrictions.append('check_sender_access hash:/usr/local/etc/postfix/sender_access') %} +{% endif %} {% if helpers.exists('OPNsense.postfix.recipient.recipients.recipient') %} {% do smtpd_recipient_restrictions.append('check_recipient_access hash:/usr/local/etc/postfix/recipient_access') %} {% endif %} {% if helpers.exists('OPNsense.postfix.general.reject_unauth_pipelining') and OPNsense.postfix.general.reject_unauth_pipelining == '1' %} {% do smtpd_recipient_restrictions.append('reject_unauth_pipelining') %} {% endif %} -{% if helpers.exists('OPNsense.postfix.sender.senders.sender') %} -{% do smtpd_recipient_restrictions.append('check_sender_access hash:/usr/local/etc/postfix/sender_access') %} -{% endif %} {% if helpers.exists('OPNsense.postfix.general.reject_unknown_sender_domain') and OPNsense.postfix.general.reject_unknown_sender_domain == '1' %} {% do smtpd_recipient_restrictions.append('reject_unknown_sender_domain') %} {% endif %}