[pmg-devel] [PATCH pmg-api] quarantine: ticket: use raw pmail for ticket assembly

Stoiko Ivanov s.ivanov at proxmox.com
Wed Sep 13 18:20:46 CEST 2023


currently the quarantine report does not work if the recipient has
some encodable characters in their local part - e.g.
'some&other at 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 at domain.example' instead of 'some&other at domain.example'
and the listing works as expected

Signed-off-by: Stoiko Ivanov <s.ivanov at 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





More information about the pmg-devel mailing list