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 140441FF142 for ; Fri, 19 Jun 2026 11:34:44 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E40879C9E; Fri, 19 Jun 2026 11:34:43 +0200 (CEST) Date: Fri, 19 Jun 2026 11:34:08 +0200 From: Stoiko Ivanov To: Dominik Csapak Subject: Re: [PATCH pmg-yew-quarantine-gui] spam list: open mail when given via query parameter Message-ID: <20260619113408.3325701f@rosa.proxmox.com> In-Reply-To: <20260617105617.2351595-1-d.csapak@proxmox.com> References: <20260617105617.2351595-1-d.csapak@proxmox.com> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1781861643805 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.033 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 POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: LG5ZONC5YOYZCMUB2KB5W7RLXTCNLWYN X-Message-ID-Hash: LG5ZONC5YOYZCMUB2KB5W7RLXTCNLWYN X-MailFrom: s.ivanov@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: pmg-devel@lists.proxmox.com 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: Thanks for the patch! checked it out and gave it a spin - looks fine and works as advertised: Reviewed-by: Stoiko Ivanov Tested-by: Stoiko Ivanov FWIW: while there I noticed an error in the browser dev-tools console: `Could not load acl tree - api error (status = 501: Method 'GET /access/acl' not implemented` looked around and saw: https://git.proxmox.com/?p=ui/proxmox-yew-comp.git;a=commitdiff;h=a9524ba99c93d3eddfbf4a28552b9abfaabfb534 -> verified that the patch fixes the spurious error. On Wed, 17 Jun 2026 12:56:11 +0200 Dominik Csapak wrote: > In the quarantine summary e-mail, there are links for the actions of > mails but also a link that should just open the specific mail in the > quarantine interface without an action. > > In the mobile UI, only the action was actually implemented, but not the > opening when no action was selected. > > Implement that by handling id and action separately while extracting and > calling the 'on_preview' callback in case no action was present. > > Reported in the forums: > https://forum.proxmox.com/threads/174685/#post-857716 > > Signed-off-by: Dominik Csapak > --- > src/spam_list.rs | 25 +++++++++++++++---------- > 1 file changed, 15 insertions(+), 10 deletions(-) > > diff --git a/src/spam_list.rs b/src/spam_list.rs > index 95a0611..cd4365a 100644 > --- a/src/spam_list.rs > +++ b/src/spam_list.rs > @@ -144,10 +144,14 @@ impl Component for PmgSpamList { > _reload_observer: reload_observer, > }; > > - match extract_mail_action_from_query_params() { > - Ok(None) => {} > - Ok(Some((id, action))) => { > - ctx.link().send_message(Msg::Action(id, action)); > + match extract_mail_info_from_query_param() { > + Ok((None, _)) => {} > + Ok((Some(id), action)) => { > + if let Some(action) = action { > + ctx.link().send_message(Msg::Action(id, action)); > + } else if let Some(on_preview) = &ctx.props().on_preview { > + on_preview.emit(id.clone()) > + } > } > Err(err) => { > ctx.link().show_snackbar( > @@ -358,15 +362,16 @@ fn epoch_to_date(epoch: i64) -> String { > ) > } > > -fn extract_mail_action_from_query_params() -> Result, Error> { > +fn extract_mail_info_from_query_param() -> Result<(Option, Option), Error> { > let id = extract_query_parameter("cselect")?; > let action = extract_query_parameter("action")?; > > - if let (Some(id), Some(action)) = (id, action) { > - let action = MailAction::from_str(&action)?; > - return Ok(Some((id, action))); > - } > - Ok(None) > + let action = match action { > + Some(action) => Some(MailAction::from_str(&action)?), > + None => None, > + }; > + > + Ok((id, action)) > } > > /// Removes `name` parameter from the get values via the browser `history` object and returns it