From: Carsten Haerle <carsten.haerle@straightec.de>
To: pmg-devel@lists.proxmox.com
Cc: Carsten Haerle <carsten.haerle@straightec.de>
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 [thread overview]
Message-ID: <20261026095852.3243241-6-carsten.haerle@straightec.de> (raw)
In-Reply-To: <20261026095852.3243241-1-carsten.haerle@straightec.de>
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 <carsten.haerle@straightec.de>
---
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', {
me.add_boolean_row('hide_received', gettext('Hide Internal Hosts'));
+ me.add_boolean_row('trust_local_network', gettext('Trust Local Network'), {
+ 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', {
let run_editor = function () {
let rec = 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) => !rec.data.automatic,
handler: run_editor,
},
{
xtype: 'proxmoxStdRemoveButton',
selModel: me.selModel,
+ enableFn: (rec) => !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) => (rec.data.automatic ? 'proxmox-disabled-row' : ''),
},
columns: [
{
--
2.53.0
next prev parent reply other threads:[~2026-10-27 9:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 9:58 [PATCH pmg-api/pmg-gui/pmg-docs 0/6] fix #8231: mail proxy: make automatically trusted networks visible and the local network optional Carsten Haerle
2026-10-26 9:58 ` [PATCH pmg-api 1/6] fix #8231: config: add option to not trust the local network automatically Carsten Haerle
2026-10-26 9:58 ` [PATCH pmg-api 2/6] config: factor out automatically trusted networks Carsten Haerle
2026-10-26 9:58 ` [PATCH pmg-api 3/6] fix #8231: api: mynetworks: optionally list " Carsten Haerle
2026-10-26 9:58 ` [PATCH pmg-api 4/6] fix #8231: config: resolve relay and transport host names for mynetworks Carsten Haerle
2026-10-26 9:58 ` Carsten Haerle [this message]
2026-10-26 9:58 ` [PATCH pmg-docs 6/6] mail proxy: networks: document automatically trusted networks Carsten Haerle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261026095852.3243241-6-carsten.haerle@straightec.de \
--to=carsten.haerle@straightec.de \
--cc=pmg-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox