From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 37B866037E for ; Tue, 17 Nov 2020 09:05:16 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2F7DFCFE7 for ; Tue, 17 Nov 2020 09:05:16 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id DD3C7CFBB for ; Tue, 17 Nov 2020 09:05:14 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 9DE4D43772 for ; Tue, 17 Nov 2020 09:05:14 +0100 (CET) From: Dominik Csapak To: pmg-devel@lists.proxmox.com Date: Tue, 17 Nov 2020 09:05:11 +0100 Message-Id: <20201117080513.15046-3-d.csapak@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201117080513.15046-1-d.csapak@proxmox.com> References: <20201117080513.15046-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.357 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pmg-devel] [PATCH pmg-api 2/3] add 'quarantinelink' to admin config X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Nov 2020 08:05:16 -0000 to enable the 'Request Quarantine Link' button and api call Signed-off-by: Dominik Csapak --- src/PMG/Config.pm | 6 ++++++ src/PMG/Service/pmgproxy.pm | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/PMG/Config.pm b/src/PMG/Config.pm index cd69c9c..c7e2aca 100755 --- a/src/PMG/Config.pm +++ b/src/PMG/Config.pm @@ -126,6 +126,11 @@ sub properties { description => "Default DKIM selector", type => 'string', format => 'dns-name', #see RFC6376 3.1 }, + quarantinelink => { + description => "Enables user self-service for Quarantine Links. Caution: this is accessible without authentication", + type => 'boolean', + default => 0, + }, }; } @@ -144,6 +149,7 @@ sub options { dkim_sign => { optional => 1 }, dkim_sign_all_mail => { optional => 1 }, dkim_selector => { optional => 1 }, + quarantinelink => { optional => 1 }, }; } diff --git a/src/PMG/Service/pmgproxy.pm b/src/PMG/Service/pmgproxy.pm index ea58b50..6d51048 100755 --- a/src/PMG/Service/pmgproxy.pm +++ b/src/PMG/Service/pmgproxy.pm @@ -21,6 +21,7 @@ use PVE::APIServer::Utils; use PMG::HTTPServer; use PMG::API2; +use PMG::Config; use Template; @@ -227,6 +228,8 @@ sub get_index { $version = $1; }; + my $cfg = PMG::Config->new(); + my $quarantinelink = $cfg->get('admin', 'quarantinelink'); $username = '' if !$username; @@ -242,6 +245,7 @@ sub get_index { debug => $args->{debug} || $server->{debug}, version => $version, wtversion => $wtversion, + quarantinelink => $quarantinelink, }; my $template_name; -- 2.20.1