From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 5F3191FF17C for ; Wed, 17 Sep 2025 17:21:54 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BEB4F9AEA; Wed, 17 Sep 2025 17:22:08 +0200 (CEST) Message-ID: <569e83ee-46cb-4496-94e7-76eeea6f804d@proxmox.com> Date: Wed, 17 Sep 2025 17:22:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta To: Hannes Laimer , pmg-devel@lists.proxmox.com References: <20250808102836.50441-1-h.laimer@proxmox.com> Content-Language: en-US From: Thomas Lamprecht In-Reply-To: <20250808102836.50441-1-h.laimer@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1758122517700 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.028 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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. [utils.pm, spamreport-short.tt, pmgqm.pm, spamreport-verbose.tt] Subject: Re: [pmg-devel] [PATCH pmg-api v2] fix #2452: pmgqm support 1-24h timespans for status/send 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pmg-devel-bounces@lists.proxmox.com Sender: "pmg-devel" Am 08.08.25 um 12:28 schrieb Hannes Laimer: > Signed-off-by: Hannes Laimer > --- > I didn't find a section for this in the docs(maybe I missed it), if > there is one, and depending on what it says maybe we have to update that > as well. (I can send a followup in that case) > > since v1: > - update default templates > - 1..24h instead of 1..23h (thought `today` would be 24h, but it's not) > > src/PMG/CLI/pmgqm.pm | 8 ++++---- > src/PMG/Utils.pm | 10 ++++++++-- > src/templates/spamreport-short.tt | 4 +++- > src/templates/spamreport-verbose.tt | 4 +++- > 4 files changed, 18 insertions(+), 8 deletions(-) > > diff --git a/src/PMG/CLI/pmgqm.pm b/src/PMG/CLI/pmgqm.pm > index 23968f2..41f9f1a 100755 > --- a/src/PMG/CLI/pmgqm.pm > +++ b/src/PMG/CLI/pmgqm.pm > @@ -90,9 +90,9 @@ __PACKAGE__->register_method({ > additionalProperties => 0, > properties => { > timespan => { > - description => "Select time span.", > + description => "Select time span. Accepts 'today', 'yesterday', 'week' or '1h'..'24h' for the last N hours.", > type => 'string', > - enum => ['today', 'yesterday', 'week'], > + pattern => '^(today|yesterday|week|([1-9]|1[0-9]|2[0-4])h)$', Oh and FWIW, was fine as is, but it would have been a potential use case for the relatively new oneOf schema support to split the enum and the more free form variants into two different sub-schemas. Mostly mentioning it to ensure it's known to a wider audience that using the oneOf schema would (or at least should ;) be possible in the perl based APIs too. _______________________________________________ pmg-devel mailing list pmg-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel