From ab1feb23c498bdbd32fca32a638a80f937bfb298 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sun, 1 Jul 2018 12:15:52 +0200 Subject: [PATCH] mail/postfix: merge version 1.4 from master --- mail/postfix/Makefile | 2 +- .../mvc/app/controllers/OPNsense/Postfix/forms/general.xml | 7 +++++++ .../opnsense/mvc/app/models/OPNsense/Postfix/General.xml | 6 +++++- .../opnsense/service/templates/OPNsense/Postfix/main.cf | 4 ++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index cecd43ede..60dbea2dd 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= postfix -PLUGIN_VERSION= 1.3 +PLUGIN_VERSION= 1.4 PLUGIN_COMMENT= SMTP mail relay PLUGIN_DEPENDS= postfix-sasl PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml index d94958ff7..b7aecbb3c 100644 --- a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml +++ b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml @@ -117,6 +117,13 @@ password The password to use for SMTP authentication. + + general.enforce_recipient_check + + checkbox + true + If you enable this, every entry in Recipients will be checked against. When there is no match mail will be rejected. Be aware that it does not matter if the action is "OK" or "REJECT". This setup allows you to run postfix in front of an internal system and already rejecting unsolicited mail at the border. + general.reject_unauth_pipelining diff --git a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/General.xml b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/General.xml index ada619c2a..1a8a36f30 100644 --- a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/General.xml +++ b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/General.xml @@ -1,7 +1,7 @@ //OPNsense/postfix/general Postfix configuration - 1.2.0 + 1.2.1 0 @@ -85,6 +85,10 @@ N + + 0 + Y + 1 Y 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 035a07009..03f83f8d4 100644 --- a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf +++ b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf @@ -112,6 +112,10 @@ milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen} milter_default_action = accept {% endif %} +{% if helpers.exists('OPNsense.postfix.general.enforce_recipient_check') and OPNsense.postfix.general.enforce_recipient_check == '1' %} +relay_recipient_maps = hash:/usr/local/etc/postfix/recipient_access +{% endif %} + {# Sender Restrictions #} {% set smtpd_recipient_restrictions=[] %} {% if helpers.exists('OPNsense.postfix.recipient.recipients.recipient') %}