From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 932AC1FF0B0 for ; Tue, 27 Oct 2026 10:31:36 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 6664F216B7; Tue, 27 Oct 2026 10:31:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=straightec.de; s=dkim; t=1793008735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SrZnF0/QPFPqsDYSGlbEciy2QyjZ/gnOG2c0aT3xQpE=; b=rHLyhFbnXZ+im5/0eogZhgwRjskInKPYZcKTk9Dyt+Juy3N4KVoqlq3zCtpXO6H0TVB06o BVhtQQEgZFCeQXZ90RYljek0Nd5HD84+vu+/IR4DqOyPKUYaRvFUTEWYF81KUiTPXXK/qr uUyLti8SybDzZfkWMYTK0GRe9jyO5danw8TnLUVTHzyhw/GTfV4oe0AtIVL/dbbDs0wXLe g5g6ZhZ0/HGZylAcdfyqsRxAgmfcDgDqZy1+pbMTC1S3OuVObqEDe6hN4ryeNUI+Xug6l/ 0+vXBSgLJu4ryB7AWLJuH+u4dHZ+IKyZiX6q5QREeJoSXDRNbjCTGZx3cqRMEw== From: Carsten Haerle To: pmg-devel@lists.proxmox.com Subject: [PATCH pmg-gui 5/6] fix #8231: mail proxy: add trust local network option, show automatic networks Date: Mon, 26 Oct 2026 10:58:50 +0100 Message-ID: <20261026095852.3243241-6-carsten.haerle@straightec.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261026095852.3243241-1-carsten.haerle@straightec.de> References: <20261026095852.3243241-1-carsten.haerle@straightec.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record X-MailFrom: carsten.haerle@straightec.de X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation Message-ID-Hash: VVLH52DENKTDKQR3ODUBZGLADN4EVOBQ X-Message-ID-Hash: VVLH52DENKTDKQR3ODUBZGLADN4EVOBQ X-Mailman-Approved-At: Tue, 27 Oct 2026 10:31:21 +0100 CC: Carsten Haerle X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add the 'Trust Local Network' option to the mail proxy options and list the networks that are trusted automatically (local network, default relay, transport hosts) in the Networks panel. They are shown greyed out with a comment that tells where they come from, and cannot be edited or removed there. This makes visible what postfix actually trusts, which so far could only be seen in the generated main.cf. Requires the 'automatic' parameter of the mynetworks API in pmg-api. Signed-off-by: Carsten Haerle --- js/MailProxyOptions.js | 4 ++++ js/MyNetworks.js | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/js/MailProxyOptions.js b/js/MailProxyOptions.js index 51d6778..b182846 100644 --- a/js/MailProxyOptions.js +++ b/js/MailProxyOptions.js @@ -61,6 +61,10 @@ Ext.define('PMG.MailProxyOptions', { =20 me.add_boolean_row('hide_received', gettext('Hide Internal Hosts')= ); =20 + me.add_boolean_row('trust_local_network', gettext('Trust Local Net= work'), { + defaultValue: 1, + }); + me.add_boolean_row('log-headers', gettext('Log Header Information'= ), { onlineHelp: 'pmgconfig_mailproxy_log_headers', }); diff --git a/js/MyNetworks.js b/js/MyNetworks.js index 3ac5eb9..84df290 100644 --- a/js/MyNetworks.js +++ b/js/MyNetworks.js @@ -1,9 +1,10 @@ Ext.define('pmg-mynetworks', { extend: 'Ext.data.Model', - fields: ['cidr', 'comment'], + fields: ['cidr', 'comment', { name: 'automatic', type: 'boolean' }], proxy: { type: 'proxmox', url: '/api2/json/config/mynetworks', + extraParams: { automatic: 1 }, }, idProperty: 'cidr', }); @@ -28,7 +29,7 @@ Ext.define('PMG.MyNetworks', { =20 let run_editor =3D function () { let rec =3D me.selModel.getSelection()[0]; - if (!rec) { + if (!rec || rec.data.automatic) { return; } Ext.createWidget('proxmoxWindowEdit', { @@ -90,11 +91,13 @@ Ext.define('PMG.MyNetworks', { text: gettext('Edit'), disabled: true, selModel: me.selModel, + enableFn: (rec) =3D> !rec.data.automatic, handler: run_editor, }, { xtype: 'proxmoxStdRemoveButton', selModel: me.selModel, + enableFn: (rec) =3D> !rec.data.automatic, baseurl: '/config/mynetworks', callback: reload, waitMsgTarget: me, @@ -114,6 +117,8 @@ Ext.define('PMG.MyNetworks', { run_editor: run_editor, viewConfig: { trackOver: false, + // automatically trusted networks cannot be modified here + getRowClass: (rec) =3D> (rec.data.automatic ? 'proxmox-dis= abled-row' : ''), }, columns: [ { --=20 2.53.0