From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-api] quarantine: ticket: use raw pmail for ticket assembly
Date: Wed, 13 Sep 2023 18:20:46 +0200 [thread overview]
Message-ID: <20230913162046.12637-1-s.ivanov@proxmox.com> (raw)
currently the quarantine report does not work if the recipient has
some encodable characters in their local part - e.g.
'some&other@domain.example'
when clicking on the links on the report the user gets logged in
however their quarantine list is empty (the call to
/api2/json/quarantine/spamusers returns 403)
With this patch the ticket (thus also the username remains
'some&other@domain.example' instead of 'some&other@domain.example'
and the listing works as expected
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
Tested this quickly here in my test-setup - but would really need some
feedback on potential pitfalls, as this is authentication-related code...
src/PMG/CLI/pmgqm.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/PMG/CLI/pmgqm.pm b/src/PMG/CLI/pmgqm.pm
index 7293579..987ddc9 100755
--- a/src/PMG/CLI/pmgqm.pm
+++ b/src/PMG/CLI/pmgqm.pm
@@ -316,7 +316,7 @@ __PACKAGE__->register_method ({
$data->{pmail_raw} = $ref->{pmail};
$data->{managehref} = "$protocol_fqdn_port/quarantine";
if ($data->{authmode} ne 'ldap') {
- $data->{ticket} = PMG::Ticket::assemble_quarantine_ticket($data->{pmail});
+ $data->{ticket} = PMG::Ticket::assemble_quarantine_ticket($data->{pmail_raw});
my $esc_ticket = uri_escape($data->{ticket});
$data->{managehref} .= "?ticket=${esc_ticket}";
}
--
2.39.2
next reply other threads:[~2023-09-13 16:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-13 16:20 Stoiko Ivanov [this message]
2023-09-22 9:37 ` Stoiko Ivanov
2023-09-26 7:06 ` [pmg-devel] applied: " Thomas Lamprecht
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=20230913162046.12637-1-s.ivanov@proxmox.com \
--to=s.ivanov@proxmox.com \
--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