From dcabce0bda0a6556a7a1336ae84c2aea70cc1c50 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 29 May 2018 08:44:09 +0200 Subject: [PATCH] mail/postfix: merge version 1.3 from master --- mail/postfix/Makefile | 2 +- .../controllers/OPNsense/Postfix/forms/general.xml | 14 ++++++++++++++ .../mvc/app/models/OPNsense/Postfix/General.xml | 8 ++++++++ .../service/templates/OPNsense/Postfix/main.cf | 6 ++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index 443b79cf3..cecd43ede 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= postfix -PLUGIN_VERSION= 1.2 +PLUGIN_VERSION= 1.3 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 0a7480b50..d94958ff7 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 @@ -29,6 +29,20 @@ text The 'Listen IPs' parameter specifies the IP address to listen to. Default is to listen on all interfaces. + + general.bind_address + + text + true + Specify the IPv4 address the server should bind to for outgoing connections. In most cases empty is fine. + + + general.bind_address6 + + text + true + Specify the IPv6 address the server should bind to for outgoing connections. In most cases empty is fine. + general.mynetworks 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 4cc93b3db..ada619c2a 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 @@ -23,6 +23,14 @@ all Y + + N + ipv4 + + + N + ipv6 + 127.0.0.0/8,[::ffff:127.0.0.0]/104,[::1]/128 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 58a9d1abe..035a07009 100644 --- a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf +++ b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf @@ -55,6 +55,12 @@ inet_interfaces = {{ OPNsense.postfix.general.inet_interfaces }} {% else %} inet_interfaces = all {% endif %} +{% if helpers.exists('OPNsense.postfix.general.bind_address') and OPNsense.postfix.general.bind_address != '' %} +smtp_bind_address = {{ OPNsense.postfix.general.bind_address }} +{% endif %} +{% if helpers.exists('OPNsense.postfix.general.bind_address6') and OPNsense.postfix.general.bind_address6 != '' %} +smtp_bind_address6 = {{ OPNsense.postfix.general.bind_address6 }} +{% endif %} {% if helpers.exists('OPNsense.postfix.general.mynetworks') and OPNsense.postfix.general.mynetworks != '' %} mynetworks = {{ OPNsense.postfix.general.mynetworks.replace(',', ' ') }} {% else %}