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 7238460660 for ; Tue, 17 Nov 2020 14:20:08 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 70585113AB for ; Tue, 17 Nov 2020 14:20:08 +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 F1A901139D for ; Tue, 17 Nov 2020 14:20:07 +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 B9EAD437BC for ; Tue, 17 Nov 2020 14:20:07 +0100 (CET) Date: Tue, 17 Nov 2020 14:20:06 +0100 From: Stoiko Ivanov To: Dominik Csapak Cc: pmg-devel@lists.proxmox.com Message-ID: <20201117142006.6b029081@rosa.proxmox.com> In-Reply-To: <20201117080513.15046-3-d.csapak@proxmox.com> References: <20201117080513.15046-1-d.csapak@proxmox.com> <20201117080513.15046-3-d.csapak@proxmox.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.086 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [html.tt, pmgproxy.pm, config.pm] Subject: Re: [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 13:20:08 -0000 On Tue, 17 Nov 2020 09:05:11 +0100 Dominik Csapak wrote: > 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; nit: I would probably put the change to pmgproxy in the next patch (where it actually gets used in the index.html.tt template